projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20100315-2-src
[rocksndiamonds.git]
/
src
/
game_sp
/
InitGameConditions.c
diff --git
a/src/game_sp/InitGameConditions.c
b/src/game_sp/InitGameConditions.c
index d5818d25acbc285be57c8c64348d5483457ec40b..937d4dc543d3c5d8e5a85139f0c28b54ee877f00 100644
(file)
--- a/
src/game_sp/InitGameConditions.c
+++ b/
src/game_sp/InitGameConditions.c
@@
-4,19
+4,14
@@
#include "InitGameConditions.h"
#include "InitGameConditions.h"
-// static char *VB_Name = "modInitGameConditions";
-
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Init game conditions (variables)
// ==========================================================================
// ==========================================================================
// SUBROUTINE
// Init game conditions (variables)
// ==========================================================================
-
int
subInitGameConditions()
+
void
subInitGameConditions()
{
{
- int subInitGameConditions;
-
bCapturePane = False;
MurphyVar0DAC = MurphyYPos;
bCapturePane = False;
MurphyVar0DAC = MurphyYPos;
@@
-26,21
+21,10
@@
int subInitGameConditions()
ExitToMenuFlag = 0;
LeadOutCounter = 0; // quit flag: lead-out counter
RedDiskCount = 0; // Red disk counter
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
ExplosionShake = 0; // Force explosion flag off
@@
-48,18
+32,17
@@
int subInitGameConditions()
YellowDisksExploded = 0;
TimerVar = 0;
YellowDisksExploded = 0;
TimerVar = 0;
+
// ShowPanel = 1 ' Force Panel on
// MainForm.PanelVisible = True;
// 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
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
+}
// ==========================================================================
// ==========================================================================
@@
-67,28
+50,21
@@
int subInitGameConditions()
// Locate Murphy and init location.
// ==========================================================================
// Locate Murphy and init location.
// ==========================================================================
-
int
InitMurphyPos()
+
void
InitMurphyPos()
{
{
- int InitMurphyPos;
-
int si;
for (si = 0; si <= LevelMax - 1; si++)
int si;
for (si = 0; si <= LevelMax - 1; si++)
- {
if (PlayField16[si] == fiMurphy)
break;
if (PlayField16[si] == fiMurphy)
break;
- }
InitMurphyPosB(si);
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;
MurphyYPos = GetStretchY(si) / Stretch;
MurphyXPos = GetStretchX(si) / Stretch;
@@
-96,26
+72,22
@@
int InitMurphyPosB(int si)
MurphyScreenYPos = GetStretchY(si); // Murphy's screen y-position
// To Do: draw Murphy in location ax
MurphyScreenYPos = GetStretchY(si); // Murphy's screen y-position
// To Do: draw Murphy in location ax
- StretchedSprites.Blt
Ex(MurphyScreenXPos, MurphyScreenYPos, fiMurphy
);
+ StretchedSprites.Blt
Img(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0
);
MurphyScreenXPos = MurphyScreenXPos / Stretch;
MurphyScreenYPos = MurphyScreenYPos / Stretch;
subCalculateScreenScrollPos(); // calculate screen start addrs
MurphyScreenXPos = MurphyScreenXPos / Stretch;
MurphyScreenYPos = MurphyScreenYPos / Stretch;
subCalculateScreenScrollPos(); // calculate screen start addrs
+
if (AutoScrollFlag)
{
if (bPlaying)
if (AutoScrollFlag)
{
if (bPlaying)
- {
SoftScrollTo(ScreenScrollXPos, ScreenScrollYPos, 1000, 25);
SoftScrollTo(ScreenScrollXPos, ScreenScrollYPos, 1000, 25);
- }
else
else
- {
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
- }
}
}
+}
- return InitMurphyPosB;
-} // InitMurphyPosB
// ==========================================================================
// SUBROUTINE
// ==========================================================================
// SUBROUTINE
@@
-124,10
+96,6
@@
int InitMurphyPosB(int si)
int subConvertToEasySymbols()
{
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;
int ax, bx, cx, dx, i;
int al;
@@
-248,20
+216,17
@@
loc_g_2778:
if (0 < cx) // Until all done 'loc_g_2782:
goto loc_g_26C9;
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
// ==========================================================================
// ==========================================================================
// 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;
if (LInfo.InfotronsNeeded != 0) // Jump If equal (autodetect)
{
dx = LInfo.InfotronsNeeded;
@@
-269,10
+234,7
@@
int ResetInfotronsNeeded(int dx)
InfotronsNeeded = LowByte(dx); // Remaining Infotrons needed
TotalInfotronsNeeded = InfotronsNeeded; // Number of Infotrons needed
InfotronsNeeded = LowByte(dx); // Remaining Infotrons needed
TotalInfotronsNeeded = InfotronsNeeded; // Number of Infotrons needed
- subDisplayInfotronsNeeded();
-
- return ResetInfotronsNeeded;
-} // ResetInfotronsNeeded
+}
// ==========================================================================
// ==========================================================================
@@
-280,25
+242,19
@@
int ResetInfotronsNeeded(int dx)
// Fetch and initialize a level
// ==========================================================================
// Fetch and initialize a level
// ==========================================================================
-
int
subFetchAndInitLevelB()
+
void
subFetchAndInitLevelB()
{
{
- int subFetchAndInitLevelB;
-
boolean UpdatePlayTime;
boolean UpdatePlayTime;
- MovLowByte(&data_SPtorunavail, 0); // no SP file
data_scr_demo = 0;
data_scr_demo = 0;
- UpdatePlayTime = (0 == demo_stopped ?
True : Tru
e);
+ UpdatePlayTime = (0 == demo_stopped ?
True : Fals
e);
demo_stopped = 0;
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
if (UpdatePlayTime && (0 == demo_stopped))
{
subUpdatePlayingTime(); // update playing time
@@
-334,14
+290,10
@@
int subFetchAndInitLevelA(boolean UpdatePlayTime)
DemoKeyRepeatCounter = 1;
subGetNextDemoKey(); // get next demo byte
}
DemoKeyRepeatCounter = 1;
subGetNextDemoKey(); // get next demo byte
}
+}
- return subFetchAndInitLevelA;
-} // subFetchAndInitLevela
-
-int subFetchAndInitLevel()
+void subFetchAndInitLevel()
{
{
- int subFetchAndInitLevel;
-
int InfoCountInLevel;
Trace("modInitGameConditions", "--> subFetchAndInitLevel");
int InfoCountInLevel;
Trace("modInitGameConditions", "--> subFetchAndInitLevel");
@@
-352,14
+304,8
@@
int subFetchAndInitLevel()
Trace("modInitGameConditions", "ReadLevel return subFetchAndInitLeveled");
if (RecordDemoFlag == 1)
Trace("modInitGameConditions", "ReadLevel return subFetchAndInitLeveled");
if (RecordDemoFlag == 1)
- {
RecDemoRandomSeed = RandomSeed;
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");
GameBusyFlag = -GameBusyFlag; // make <>1
Trace("modInitGameConditions", "subConvertToEasySymbols");
@@
-370,7
+316,6
@@
int subFetchAndInitLevel()
Trace("modInitGameConditions", "subDisplayLevel");
subDisplayLevel(); // Paint (Init) game field
Trace("modInitGameConditions", "subDisplayLevel");
subDisplayLevel(); // Paint (Init) game field
- subDisplayPanel(); // Paint (Init) Panel
ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count
ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count
@@
-383,6
+328,4
@@
int subFetchAndInitLevel()
InitMurphyPos(); // Locate Murphy + screen pos
Trace("modInitGameConditions", "<-- subFetchAndInitLevel");
InitMurphyPos(); // Locate Murphy + screen pos
Trace("modInitGameConditions", "<-- subFetchAndInitLevel");
-
- return subFetchAndInitLevel;
-} // subFetchAndInitLevel
+}