-#define COMPILE_DATE_STRING "2010-02-24 00:22"
+#define COMPILE_DATE_STRING "2010-03-02 23:49"
local_player->LevelSolved_CountingTime :
level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->time :
+ level.game_engine_type == GAME_ENGINE_TYPE_SP ?
+ level.native_sp_level->game_sp->time_played :
level.time == 0 ? TimePlayed : TimeLeft);
int score = (local_player->LevelSolved ?
local_player->LevelSolved_CountingScore :
level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->score :
+ level.game_engine_type == GAME_ENGINE_TYPE_SP ?
+ level.native_sp_level->game_sp->score :
local_player->score);
int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required :
+ level.game_engine_type == GAME_ENGINE_TYPE_SP ?
+ level.native_sp_level->game_sp->infotrons_still_needed :
local_player->gems_still_needed);
int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required > 0 :
+ level.game_engine_type == GAME_ENGINE_TYPE_SP ?
+ level.native_sp_level->game_sp->infotrons_still_needed > 0 :
local_player->gems_still_needed > 0 ||
local_player->sokobanfields_still_needed > 0 ||
local_player->lights_still_needed > 0);
{
for (i = 0; i < MAX_PLAYERS; i++)
{
+ /* only one player in Supaplex game engine */
+ if (level.game_engine_type == GAME_ENGINE_TYPE_SP && i > 0)
+ break;
+
for (k = 0; k < MAX_NUM_KEYS; k++)
{
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
level.native_em_level->ply[i]->dynamite;
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
+ game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
+ level.native_sp_level->game_sp->red_disk_count;
else
game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
stored_player[i].inventory_size;
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
level.native_em_level->ply[player_nr]->dynamite;
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
+ game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
+ level.native_sp_level->game_sp->red_disk_count;
else
game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value +=
stored_player[player_nr].inventory_size;
#include "ASM.h"
-// static char *VB_Name = "modASM";
-
-// --- Option Explicit
-
-// PseudoRegisters:
-// Public ax%, bx%
-// --- const int ByteMask = 0xFF;
-int cmpFlag;
-
-void Neg(int *Val)
-{
- *Val = -*Val;
-}
void Mov(int *Var, int Val)
{
Tmp = Val & 0x7F;
Tmp = 0x100 * Tmp;
+
if ((Val & 0x80) != 0)
Tmp = Tmp | 0x8000;
{
int LowByte;
- // Dim Tmp As Byte
LowByte = (Var & 0xFF);
- // LowByte = ByteToInt(Tmp)
return LowByte;
}
int HighByte;
if (Var & 0x8000)
- {
HighByte = ((Var & 0x7FFF) / 0x100) | 0x80;
- }
else
- {
HighByte = Var / 0x100;
- }
return HighByte;
}
#endif
if (Var & 0x8000)
- {
SgnHighByte = ((Var & 0x7FFF) / 0x100) | 0xFF80;
- }
else
- {
SgnHighByte = Var / 0x100;
- }
return SgnHighByte;
}
-boolean Less()
-{
- boolean Less;
-
- Less = (cmpFlag < 0);
-
- return Less;
-}
-
-boolean GreaterOrEqual()
-{
- boolean GreaterOrEqual;
-
- GreaterOrEqual = (0 <= cmpFlag);
-
- return GreaterOrEqual;
-}
-
-boolean Equal()
+int SHL(int *Var, int Count)
{
- boolean Equal;
-
- Equal = (0 == cmpFlag);
+ int SHL;
- return Equal;
-}
+ int i;
-void CMP(int A, int B)
-{
- cmpFlag = A - B;
-}
+ for (i = 1; i <= Count; i++)
+ {
+ *Var = *Var & 0x7FFF;
-void Add(int *A, int B)
-{
- *A = *A + B;
-}
+ if ((*Var & 0x4000) != 0)
+ *Var = (2 * (*Var & 0x3FFF)) | 0x8000;
+ else
+ *Var = 2 * *Var;
+ }
-void MySub(int *A, int B)
-{
- *A = *A - B;
+ return SHL;
}
int SHR(int *Var, int Count)
int i;
if (*Var & 0x8000)
- {
*Var = ((*Var & 0x7FFF) / 2) | 0x4000;
- }
else
- {
*Var = *Var / 2;
- }
for (i = 2; i <= Count; i++)
- {
*Var = *Var / 2;
- }
return SHR;
}
-int SHL(int *Var, int Count)
-{
- int SHL;
-
- int i;
-
- for (i = 1; i <= Count; i++)
- {
- *Var = *Var & 0x7FFF;
- if ((*Var & 0x4000) != 0)
- {
- *Var = (2 * (*Var & 0x3FFF)) | 0x8000;
- }
- else
- {
- *Var = 2 * *Var;
- }
- }
-
- return SHL;
-}
-
int ByteToInt(byte B)
{
int ByteToInt;
if ((B & 0x80) == 0x80)
- {
ByteToInt = -(0xFF - B + 1);
- }
else
- {
ByteToInt = B;
- }
return ByteToInt;
}
{
byte IntToByte;
- // IntToByte = CByte(i & 0xFF);
IntToByte = (byte)(i & 0xFF);
return IntToByte;
}
-
-void XCHG(int A, int B)
-{
- int Tmp;
-
- Tmp = B;
- B = A;
- A = Tmp;
-}
#include "global.h"
+
#define ByteMask (0xFF)
-extern void Add(int *A, int B);
-extern int ByteToInt(byte B);
-extern void CMP(int A, int B);
-extern boolean Equal();
-extern boolean GreaterOrEqual();
-extern int HighByte(int Var);
-extern byte IntToByte(int i);
-extern boolean Less();
-extern int LowByte(int Var);
extern void Mov(int *Var, int Val);
-extern void MovHighByte(int *Var, int Val);
extern void MovLowByte(int *Var, int Val);
-extern void MySub(int *A, int B);
-extern void Neg(int *Val);
+extern void MovHighByte(int *Var, int Val);
+extern int LowByte(int Var);
+extern int HighByte(int Var);
+extern int SgnHighByte(int Var);
extern int SHL(int *Var, int Count);
extern int SHR(int *Var, int Count);
-extern int SgnHighByte(int Var);
-extern void XCHG(int A, int B);
-
-extern int cmpFlag;
+extern int ByteToInt(byte B);
+extern byte IntToByte(int i);
#endif /* ASM_H */
// To Do: draw Murphy in location ax
#if 1
- StretchedSprites.BltImg(MurphyScreenXPos, MurphyScreenYPos, fiMurphy, 0);
+ StretchedSprites.BltImg(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0);
#else
StretchedSprites.BltEx(MurphyScreenXPos, MurphyScreenYPos, fiMurphy);
#endif
boolean LevelSolved;
boolean GameOver;
+ /* needed for updating panel */
+ int time_played;
+ int infotrons_still_needed;
+ int red_disk_count;
+ int score;
+
/* needed for engine snapshots */
int preceding_buffer_size;
};
byte playfield[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
struct DemoInfo_SP demo;
+
+ /* used for runtime values */
+ struct GameInfo_SP *game_sp;
};
struct GraphicInfo_SP
char *empty_title = "-------- EMPTY --------";
int i, x, y;
+ native_sp_level.game_sp = &game_sp;
+
native_sp_level.width = SP_STD_PLAYFIELD_WIDTH;
native_sp_level.height = SP_STD_PLAYFIELD_HEIGHT;
game_sp.LevelSolved = FALSE;
game_sp.GameOver = FALSE;
+ game_sp.time_played = 0;
+ game_sp.infotrons_still_needed = native_sp_level.header.InfotronsNeeded;
+ game_sp.red_disk_count = 0;
+ game_sp.score = 0;
+
menBorder.Checked = setup.sp_show_border_elements;
for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++)
BackToFront_SP();
}
+void DrawGameDoorValues_SP()
+{
+#if 1
+
+ game_sp.time_played = TimerVar / setup.game_frame_delay;
+ game_sp.infotrons_still_needed = InfotronsNeeded;
+ game_sp.red_disk_count = RedDiskCount;
+ game_sp.score = 0; // (currently no score in Supaplex engine)
+
+#else
+
+ int infotrons_still_needed = InfotronsNeeded;
+ int red_disks = RedDiskCount;
+ int no_score_in_supaplex = 0;
+#if 1
+ int level_time_played = TimerVar / setup.game_frame_delay;
+#else
+ int level_time_played = TimerVar / 35; /* !!! CHECK THIS !!! */
+#endif
+ int no_keys_in_supaplex = 0;
+
+ DrawAllGameValues(infotrons_still_needed, red_disks, no_score_in_supaplex,
+ level_time_played, no_keys_in_supaplex);
+#endif
+}
+
void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)
{
byte single_player_action = action[0];
RedrawPlayfield_SP(FALSE);
+ if (!warp_mode) /* do not redraw values in warp mode */
+ DrawGameDoorValues_SP();
+
for (x = DisplayMinX; x <= DisplayMaxX; x++)
for (y = DisplayMinY; y <= DisplayMaxY; y++)
GfxFrame[x][y]++;