for (i = 2112; i < 2148; i++)
src[i] = src[i - 64];
}
-
-#if 1 /* ================================================================== */
-
else if (length >= 2106 &&
(src[1983] == 27 || /* encrypted (only EM I/II/III) */
src[1983] == 116 || /* unencrypted (usual case) */
return FILE_VERSION_EM_UNKNOWN;
}
-#else /* ================================================================== */
-
-#if 0
- else if (length >= 2106) /* !!! TEST ONLY: SHOW BROKEN LEVELS !!! */
-#else
- else if (length >= 2106 &&
- src[1983] == 116)
-#endif
- {
- /* ---------- this cave has V4 file format ---------- */
- file_version = FILE_VERSION_EM_V4;
-
- /* remap elements to internal EMC level format */
- for (i = 0; i < 2048; i++)
- src[i] = remap_v4[src[i]];
- for (i = 2048; i < 2084; i++)
- src[i] = remap_v4eater[src[i] >= 28 ? 0 : src[i]];
- for (i = 2112; i < 2148; i++)
- src[i] = src[i - 64];
- }
- else if (length >= 2106 &&
- src[0] == 241 && /* <-- Emerald Mine I and III levels */
- src[1983] == 27)
- {
- unsigned char j = 94;
-
- /* ---------- this cave has V3 file format ---------- */
- file_version = FILE_VERSION_EM_V3;
-
- /* decrypt encrypted level file */
- for (i = 0; i < 2106; i++)
- src[i] = (src[i] ^ (j += 7)) - 0x11;
-
- src[1] = 131;
-
- /* remap elements to internal EMC level format */
- for (i = 0; i < 2048; i++)
- src[i] = remap_v4[src[i]];
- for (i = 2048; i < 2084; i++)
- src[i] = remap_v4eater[src[i] >= 28 ? 0 : src[i]];
- for (i = 2112; i < 2148; i++)
- src[i] = src[i - 64];
- }
-#if 1
- else if (length >= 2106 &&
- src[0] == 245 && /* <-- Emerald Mine II levels */
- src[1983] == 27)
- {
- unsigned char j = 94;
-
- /* ---------- this cave has V3 file format ---------- */
- file_version = FILE_VERSION_EM_V3;
-
- /* decrypt encrypted level file */
- for (i = 0; i < 2106; i++)
- src[i] = (src[i] ^ (j += 7)) - 0x11;
-
- src[0] = 131; /* needed for Emerald Mine II levels */
- src[1] = 131;
-
- /* remap elements to internal EMC level format */
- for (i = 0; i < 2048; i++)
- src[i] = remap_v4[src[i]];
- for (i = 2048; i < 2084; i++)
- src[i] = remap_v4eater[src[i] >= 28 ? 0 : src[i]];
- for (i = 2112; i < 2148; i++)
- src[i] = src[i - 64];
-
- /* fix copyright sign in Emerald Mine II levels */
- for (i = 0; i < 2048; i++)
- if (src[i] == 241)
- src[i] = 254; /* replace 'Xdecor_1' with 'Xalpha_copyr' */
- }
-#endif
- else
- {
- /* ---------- this cave has unknown file format ---------- */
-
-#if 0
- printf("::: %d, %d\n", src[0], src[1983]);
-#endif
-
- return 0;
- }
-
-#endif /* ================================================================== */
-
if (file_version < FILE_VERSION_EM_V6)
{
/* id */
/* ball data */
src[2159] = 128;
-
-#if 0
- printf("::: STORED TIME (< V6): %d s\n", src[2094] * 10);
-#endif
}
-#if 0
- else
- {
- printf("::: STORED TIME (>= V6): %d s\n", src[2110] * 256 + src[2111]);
- }
-#endif
/* ---------- at this stage, the cave data always has V6 format ---------- */
/* size of v6 cave */
length = 2172;
-#if 1
-#if 1
if (options.debug)
-#endif
printf("::: EM level file version: %d\n", file_version);
-#endif
return file_version;
}
/* at last, set the two players at their positions in the playfield */
/* (native EM[C] levels always have exactly two players in a level) */
-#if 1
for (i = 0; i < 2; i++)
native_em_level.cave[ply[i].x_initial][ply[i].y_initial] = Zplayer;
-#else
- for (i = 0; i < 2; i++)
- if (ply[i].alive_initial)
- native_em_level.cave[ply[i].x_initial][ply[i].y_initial] = Zplayer;
-#endif
native_em_level.file_version = file_version;
}
{
int i, x, y;
int players_left;
- int num_tape_players;
+ boolean team_mode;
/* reset all runtime variables to their initial values */
for (x = 0; x < WIDTH; x++)
Draw[y][x] = Cave[y][x];
-#if 1
lev.time_initial = lev.time_seconds;
-#else
- lev.time_initial = (lev.time_seconds * 50 + 7) / 8;
-#endif
lev.time = lev.time_initial;
lev.required = lev.required_initial;
}
}
- num_tape_players = getNumActivePlayers_EM();
+ team_mode = getTeamMode_EM();
- if (num_tape_players != -1)
- lev.home_initial = MIN(lev.home_initial, num_tape_players);
- else if (!setup.team_mode)
- lev.home_initial = MIN(lev.home_initial, 1);
+ if (!team_mode)
+ lev.home_initial = 1;
lev.home = lev.home_initial;
players_left = lev.home_initial;
ply[i].joy_n = ply[i].joy_e = ply[i].joy_s = ply[i].joy_w = 0;
ply[i].joy_snap = ply[i].joy_drop = 0;
ply[i].joy_stick = ply[i].joy_spin = 0;
-
-#if 0
- printf("player %d: x/y == %d/%d, alive == %d\n",
- i, ply[i].x_initial, ply[i].y_initial, ply[i].alive);
-#endif
}
game_em.any_player_moving = FALSE;
for (i = 0; i < MAX_PLAYERS; i++)
game_em.last_player_direction[i] = MV_NONE;
+
+ lev.exit_x = lev.exit_y = -1; /* kludge for playing player exit sound */
}