+ closeFile(file);
+}
+
+
+// ----------------------------------------------------------------------------
+// functions for loading BD level
+// ----------------------------------------------------------------------------
+
+#define LEVEL_TO_CAVE(e) (map_element_RND_to_BD_cave(e))
+#define CAVE_TO_LEVEL(e) (map_element_BD_to_RND_cave(e))
+
+static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
+{
+ struct LevelInfo_BD *level_bd = level->native_bd_level;
+ GdCave *cave = NULL; // will be changed below
+ int cave_w = MIN(level->fieldx, MAX_PLAYFIELD_WIDTH);
+ int cave_h = MIN(level->fieldy, MAX_PLAYFIELD_HEIGHT);
+ int x, y;
+
+ setLevelInfoToDefaults_BD_Ext(cave_w, cave_h);
+
+ // cave and map newly allocated when set to defaults above
+ cave = level_bd->cave;
+
+ // level type
+ cave->intermission = level->bd_intermission;
+
+ // level settings
+ cave->level_time[0] = level->time;
+ cave->level_diamonds[0] = level->gems_needed;
+
+ // game timing
+ cave->scheduling = level->bd_scheduling_type;
+ cave->pal_timing = level->bd_pal_timing;
+ cave->level_speed[0] = level->bd_cycle_delay_ms;
+ cave->level_ckdelay[0] = level->bd_cycle_delay_c64;
+ cave->level_hatching_delay_frame[0] = level->bd_hatching_delay_cycles;
+ cave->level_hatching_delay_time[0] = level->bd_hatching_delay_seconds;
+
+ // scores
+ cave->level_timevalue[0] = level->score[SC_TIME_BONUS];
+ cave->diamond_value = level->score[SC_EMERALD];
+ cave->extra_diamond_value = level->score[SC_DIAMOND_EXTRA];
+
+ // compatibility settings
+ cave->lineshift = level->bd_line_shifting_borders;
+ cave->border_scan_first_and_last = level->bd_scan_first_and_last_row;
+ cave->short_explosions = level->bd_short_explosions;
+
+ // player properties
+ cave->diagonal_movements = level->bd_diagonal_movements;
+ cave->active_is_first_found = level->bd_topmost_player_active;
+ cave->pushing_stone_prob = level->bd_pushing_prob * 10000;
+ cave->pushing_stone_prob_sweet = level->bd_pushing_prob_with_sweet * 10000;
+ cave->mega_stones_pushable_with_sweet = level->bd_push_mega_rock_with_sweet;
+ cave->snap_element = LEVEL_TO_CAVE(level->bd_snap_element);
+
+ // element properties
+ cave->level_bonus_time[0] = level->bd_clock_extra_time;
+ cave->voodoo_collects_diamonds = level->bd_voodoo_collects_diamonds;
+ cave->voodoo_any_hurt_kills_player = level->bd_voodoo_hurt_kills_player;
+ cave->voodoo_dies_by_stone = level->bd_voodoo_dies_by_rock;
+ cave->voodoo_disappear_in_explosion = level->bd_voodoo_vanish_by_explosion;
+ cave->level_penalty_time[0] = level->bd_voodoo_penalty_time;
+ cave->level_magic_wall_time[0] = level->time_magic_wall;
+ cave->magic_timer_zero_is_infinite = level->bd_magic_wall_zero_infinite;
+ cave->magic_timer_wait_for_hatching = level->bd_magic_wall_wait_hatching;
+ cave->magic_wall_stops_amoeba = level->bd_magic_wall_stops_amoeba;
+
+ cave->magic_diamond_to = LEVEL_TO_CAVE(level->bd_magic_wall_diamond_to);
+ cave->magic_stone_to = LEVEL_TO_CAVE(level->bd_magic_wall_rock_to);
+ cave->magic_mega_stone_to = LEVEL_TO_CAVE(level->bd_magic_wall_mega_rock_to);
+ cave->magic_nut_to = LEVEL_TO_CAVE(level->bd_magic_wall_nut_to);
+ cave->magic_nitro_pack_to = LEVEL_TO_CAVE(level->bd_magic_wall_nitro_pack_to);
+ cave->magic_flying_diamond_to = LEVEL_TO_CAVE(level->bd_magic_wall_flying_diamond_to);
+ cave->magic_flying_stone_to = LEVEL_TO_CAVE(level->bd_magic_wall_flying_rock_to);
+
+ cave->amoeba_timer_wait_for_hatching = level->bd_amoeba_wait_for_hatching;
+ cave->amoeba_timer_started_immediately= level->bd_amoeba_start_immediately;
+ cave->amoeba_2_explodes_by_amoeba = level->bd_amoeba_2_explode_by_amoeba;
+ cave->level_amoeba_threshold[0] = level->bd_amoeba_threshold_too_big;
+ cave->level_amoeba_time[0] = level->bd_amoeba_slow_growth_time;
+ cave->amoeba_growth_prob = level->bd_amoeba_slow_growth_rate * 10000;
+ cave->amoeba_fast_growth_prob = level->bd_amoeba_fast_growth_rate * 10000;
+ cave->level_amoeba_2_threshold[0] = level->bd_amoeba_2_threshold_too_big;
+ cave->level_amoeba_2_time[0] = level->bd_amoeba_2_slow_growth_time;
+ cave->amoeba_2_growth_prob = level->bd_amoeba_2_slow_growth_rate * 10000;
+ cave->amoeba_2_fast_growth_prob = level->bd_amoeba_2_fast_growth_rate * 10000;
+
+ cave->amoeba_too_big_effect = LEVEL_TO_CAVE(level->bd_amoeba_content_too_big);
+ cave->amoeba_enclosed_effect = LEVEL_TO_CAVE(level->bd_amoeba_content_enclosed);
+ cave->amoeba_2_too_big_effect = LEVEL_TO_CAVE(level->bd_amoeba_2_content_too_big);
+ cave->amoeba_2_enclosed_effect = LEVEL_TO_CAVE(level->bd_amoeba_2_content_enclosed);
+ cave->amoeba_2_explosion_effect = LEVEL_TO_CAVE(level->bd_amoeba_2_content_exploding);
+ cave->amoeba_2_looks_like = LEVEL_TO_CAVE(level->bd_amoeba_2_content_looks_like);
+
+ cave->slime_predictable = level->bd_slime_is_predictable;
+ cave->slime_correct_random = level->bd_slime_correct_random;
+ cave->level_slime_permeability[0] = level->bd_slime_permeability_rate * 10000;
+ cave->level_slime_permeability_c64[0] = level->bd_slime_permeability_bits_c64;
+ cave->level_slime_seed_c64[0] = level->bd_slime_random_seed_c64;
+ cave->level_rand[0] = level->bd_cave_random_seed_c64;
+ cave->slime_eats_1 = LEVEL_TO_CAVE(level->bd_slime_eats_element_1);
+ cave->slime_converts_1 = LEVEL_TO_CAVE(level->bd_slime_converts_to_element_1);
+ cave->slime_eats_2 = LEVEL_TO_CAVE(level->bd_slime_eats_element_2);
+ cave->slime_converts_2 = LEVEL_TO_CAVE(level->bd_slime_converts_to_element_2);
+ cave->slime_eats_3 = LEVEL_TO_CAVE(level->bd_slime_eats_element_3);
+ cave->slime_converts_3 = LEVEL_TO_CAVE(level->bd_slime_converts_to_element_3);
+
+ cave->acid_eats_this = LEVEL_TO_CAVE(level->bd_acid_eats_element);
+ cave->acid_spread_ratio = level->bd_acid_spread_rate * 10000;
+ cave->acid_turns_to = LEVEL_TO_CAVE(level->bd_acid_turns_to_element);
+
+ cave->biter_delay_frame = level->bd_biter_move_delay;
+ cave->biter_eat = LEVEL_TO_CAVE(level->bd_biter_eats_element);
+
+ cave->bladder_converts_by = LEVEL_TO_CAVE(level->bd_bladder_converts_by_element);
+
+ cave->expanding_wall_changed = level->bd_change_expanding_wall;
+
+ cave->replicators_active = level->bd_replicators_active;
+ cave->replicator_delay_frame = level->bd_replicator_create_delay;
+
+ cave->conveyor_belts_active = level->bd_conveyor_belts_active;
+ cave->conveyor_belts_direction_changed= level->bd_conveyor_belts_changed;
+
+ cave->water_does_not_flow_down = level->bd_water_cannot_flow_down;
+
+ cave->nut_turns_to_when_crushed = LEVEL_TO_CAVE(level->bd_nut_content);
+
+ cave->pneumatic_hammer_frame = level->bd_hammer_walls_break_delay;
+ cave->hammered_walls_reappear = level->bd_hammer_walls_reappear;
+ cave->hammered_wall_reappear_frame = level->bd_hammer_walls_reappear_delay;
+
+ cave->infinite_rockets = level->bd_infinite_rockets;
+
+ cave->skeletons_needed_for_pot = level->bd_num_skeletons_needed_for_pot;
+ cave->skeletons_worth_diamonds = level->bd_skeleton_worth_num_diamonds;
+
+ cave->expanding_wall_looks_like = LEVEL_TO_CAVE(level->bd_expanding_wall_looks_like);
+ cave->dirt_looks_like = LEVEL_TO_CAVE(level->bd_sand_looks_like);
+
+ cave->creatures_backwards = level->bd_creatures_start_backwards;
+ cave->creatures_direction_auto_change_on_start = level->bd_creatures_turn_on_hatching;
+ cave->creatures_direction_auto_change_time = level->bd_creatures_auto_turn_delay;
+
+ cave->gravity = level->bd_gravity_direction;
+ cave->gravity_switch_active = level->bd_gravity_switch_active;
+ cave->gravity_change_time = level->bd_gravity_switch_delay;
+ cave->gravity_affects_all = level->bd_gravity_affects_all;
+
+ cave->stone_falling_effect = LEVEL_TO_CAVE(level->bd_rock_turns_to_on_falling);
+ cave->stone_bouncing_effect = LEVEL_TO_CAVE(level->bd_rock_turns_to_on_impact);
+ cave->diamond_falling_effect = LEVEL_TO_CAVE(level->bd_diamond_turns_to_on_falling);
+ cave->diamond_bouncing_effect = LEVEL_TO_CAVE(level->bd_diamond_turns_to_on_impact);
+
+ cave->firefly_explode_to = LEVEL_TO_CAVE(level->bd_firefly_explodes_to);
+ cave->alt_firefly_explode_to = LEVEL_TO_CAVE(level->bd_firefly_2_explodes_to);
+ cave->butterfly_explode_to = LEVEL_TO_CAVE(level->bd_butterfly_explodes_to);
+ cave->alt_butterfly_explode_to = LEVEL_TO_CAVE(level->bd_butterfly_2_explodes_to);
+ cave->stonefly_explode_to = LEVEL_TO_CAVE(level->bd_stonefly_explodes_to);
+ cave->dragonfly_explode_to = LEVEL_TO_CAVE(level->bd_dragonfly_explodes_to);
+
+ cave->diamond_birth_effect = LEVEL_TO_CAVE(level->bd_diamond_birth_turns_to);
+ cave->bomb_explosion_effect = LEVEL_TO_CAVE(level->bd_bomb_explosion_turns_to);
+ cave->nitro_explosion_effect = LEVEL_TO_CAVE(level->bd_nitro_explosion_turns_to);
+ cave->explosion_effect = LEVEL_TO_CAVE(level->bd_explosion_turns_to);
+
+ // level name
+ strncpy(cave->name, level->name, sizeof(GdString));
+ cave->name[sizeof(GdString) - 1] = '\0';
+
+ // playfield elements
+ for (x = 0; x < cave->w; x++)
+ for (y = 0; y < cave->h; y++)
+ cave->map[y][x] = LEVEL_TO_CAVE(level->field[x][y]);
+}
+
+static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
+{
+ struct LevelInfo_BD *level_bd = level->native_bd_level;
+ GdCave *cave = level_bd->cave;
+ int bd_level_nr = level_bd->level_nr;
+ int x, y;
+
+ level->fieldx = MIN(cave->w, MAX_LEV_FIELDX);
+ level->fieldy = MIN(cave->h, MAX_LEV_FIELDY);
+
+ // level type
+ level->bd_intermission = cave->intermission;
+
+ // level settings
+ level->time = cave->level_time[bd_level_nr];
+ level->gems_needed = cave->level_diamonds[bd_level_nr];
+
+ // game timing
+ level->bd_scheduling_type = cave->scheduling;
+ level->bd_pal_timing = cave->pal_timing;
+ level->bd_cycle_delay_ms = cave->level_speed[bd_level_nr];
+ level->bd_cycle_delay_c64 = cave->level_ckdelay[bd_level_nr];
+ level->bd_hatching_delay_cycles = cave->level_hatching_delay_frame[bd_level_nr];
+ level->bd_hatching_delay_seconds = cave->level_hatching_delay_time[bd_level_nr];
+
+ // scores
+ level->score[SC_TIME_BONUS] = cave->level_timevalue[bd_level_nr];
+ level->score[SC_EMERALD] = cave->diamond_value;
+ level->score[SC_DIAMOND_EXTRA] = cave->extra_diamond_value;
+
+ // compatibility settings
+ level->bd_line_shifting_borders = cave->lineshift;
+ level->bd_scan_first_and_last_row = cave->border_scan_first_and_last;
+ level->bd_short_explosions = cave->short_explosions;
+
+ // player properties
+ level->bd_diagonal_movements = cave->diagonal_movements;
+ level->bd_topmost_player_active = cave->active_is_first_found;
+ level->bd_pushing_prob = cave->pushing_stone_prob / 10000;
+ level->bd_pushing_prob_with_sweet = cave->pushing_stone_prob_sweet / 10000;
+ level->bd_push_mega_rock_with_sweet = cave->mega_stones_pushable_with_sweet;
+ level->bd_snap_element = CAVE_TO_LEVEL(cave->snap_element);
+
+ // element properties
+ level->bd_clock_extra_time = cave->level_bonus_time[bd_level_nr];
+ level->bd_voodoo_collects_diamonds = cave->voodoo_collects_diamonds;
+ level->bd_voodoo_hurt_kills_player = cave->voodoo_any_hurt_kills_player;
+ level->bd_voodoo_dies_by_rock = cave->voodoo_dies_by_stone;
+ level->bd_voodoo_vanish_by_explosion = cave->voodoo_disappear_in_explosion;
+ level->bd_voodoo_penalty_time = cave->level_penalty_time[bd_level_nr];
+ level->time_magic_wall = cave->level_magic_wall_time[bd_level_nr];
+ level->bd_magic_wall_zero_infinite = cave->magic_timer_zero_is_infinite;
+ level->bd_magic_wall_wait_hatching = cave->magic_timer_wait_for_hatching;
+ level->bd_magic_wall_stops_amoeba = cave->magic_wall_stops_amoeba;
+
+ level->bd_magic_wall_diamond_to = CAVE_TO_LEVEL(cave->magic_diamond_to);
+ level->bd_magic_wall_rock_to = CAVE_TO_LEVEL(cave->magic_stone_to);
+ level->bd_magic_wall_mega_rock_to = CAVE_TO_LEVEL(cave->magic_mega_stone_to);
+ level->bd_magic_wall_nut_to = CAVE_TO_LEVEL(cave->magic_nut_to);
+ level->bd_magic_wall_nitro_pack_to = CAVE_TO_LEVEL(cave->magic_nitro_pack_to);
+ level->bd_magic_wall_flying_diamond_to= CAVE_TO_LEVEL(cave->magic_flying_diamond_to);
+ level->bd_magic_wall_flying_rock_to = CAVE_TO_LEVEL(cave->magic_flying_stone_to);
+
+ level->bd_amoeba_wait_for_hatching = cave->amoeba_timer_wait_for_hatching;
+ level->bd_amoeba_start_immediately = cave->amoeba_timer_started_immediately;
+ level->bd_amoeba_2_explode_by_amoeba = cave->amoeba_2_explodes_by_amoeba;
+ level->bd_amoeba_threshold_too_big = cave->level_amoeba_threshold[bd_level_nr];
+ level->bd_amoeba_slow_growth_time = cave->level_amoeba_time[bd_level_nr];
+ level->bd_amoeba_slow_growth_rate = cave->amoeba_growth_prob / 10000;
+ level->bd_amoeba_fast_growth_rate = cave->amoeba_fast_growth_prob / 10000;
+ level->bd_amoeba_2_threshold_too_big = cave->level_amoeba_2_threshold[bd_level_nr];
+ level->bd_amoeba_2_slow_growth_time = cave->level_amoeba_2_time[bd_level_nr];
+ level->bd_amoeba_2_slow_growth_rate = cave->amoeba_2_growth_prob / 10000;
+ level->bd_amoeba_2_fast_growth_rate = cave->amoeba_2_fast_growth_prob / 10000;
+
+ level->bd_amoeba_content_too_big = CAVE_TO_LEVEL(cave->amoeba_too_big_effect);
+ level->bd_amoeba_content_enclosed = CAVE_TO_LEVEL(cave->amoeba_enclosed_effect);
+ level->bd_amoeba_2_content_too_big = CAVE_TO_LEVEL(cave->amoeba_2_too_big_effect);
+ level->bd_amoeba_2_content_enclosed = CAVE_TO_LEVEL(cave->amoeba_2_enclosed_effect);
+ level->bd_amoeba_2_content_exploding = CAVE_TO_LEVEL(cave->amoeba_2_explosion_effect);
+ level->bd_amoeba_2_content_looks_like = CAVE_TO_LEVEL(cave->amoeba_2_looks_like);
+
+ level->bd_slime_is_predictable = cave->slime_predictable;
+ level->bd_slime_correct_random = cave->slime_correct_random;
+ level->bd_slime_permeability_rate = cave->level_slime_permeability[bd_level_nr] / 10000;
+ level->bd_slime_permeability_bits_c64 = cave->level_slime_permeability_c64[bd_level_nr];
+ level->bd_slime_random_seed_c64 = cave->level_slime_seed_c64[bd_level_nr];
+ level->bd_cave_random_seed_c64 = cave->level_rand[bd_level_nr];
+ level->bd_slime_eats_element_1 = CAVE_TO_LEVEL(cave->slime_eats_1);
+ level->bd_slime_converts_to_element_1 = CAVE_TO_LEVEL(cave->slime_converts_1);
+ level->bd_slime_eats_element_2 = CAVE_TO_LEVEL(cave->slime_eats_2);
+ level->bd_slime_converts_to_element_2 = CAVE_TO_LEVEL(cave->slime_converts_2);
+ level->bd_slime_eats_element_3 = CAVE_TO_LEVEL(cave->slime_eats_3);
+ level->bd_slime_converts_to_element_3 = CAVE_TO_LEVEL(cave->slime_converts_3);
+
+ level->bd_acid_eats_element = CAVE_TO_LEVEL(cave->acid_eats_this);
+ level->bd_acid_spread_rate = cave->acid_spread_ratio / 10000;
+ level->bd_acid_turns_to_element = CAVE_TO_LEVEL(cave->acid_turns_to);
+
+ level->bd_biter_move_delay = cave->biter_delay_frame;
+ level->bd_biter_eats_element = CAVE_TO_LEVEL(cave->biter_eat);
+
+ level->bd_bladder_converts_by_element = CAVE_TO_LEVEL(cave->bladder_converts_by);
+
+ level->bd_change_expanding_wall = cave->expanding_wall_changed;
+
+ level->bd_replicators_active = cave->replicators_active;
+ level->bd_replicator_create_delay = cave->replicator_delay_frame;
+
+ level->bd_conveyor_belts_active = cave->conveyor_belts_active;
+ level->bd_conveyor_belts_changed = cave->conveyor_belts_direction_changed;
+
+ level->bd_water_cannot_flow_down = cave->water_does_not_flow_down;
+
+ level->bd_nut_content = CAVE_TO_LEVEL(cave->nut_turns_to_when_crushed);
+
+ level->bd_hammer_walls_break_delay = cave->pneumatic_hammer_frame;
+ level->bd_hammer_walls_reappear = cave->hammered_walls_reappear;
+ level->bd_hammer_walls_reappear_delay = cave->hammered_wall_reappear_frame;
+
+ level->bd_infinite_rockets = cave->infinite_rockets;
+
+ level->bd_num_skeletons_needed_for_pot= cave->skeletons_needed_for_pot;
+ level->bd_skeleton_worth_num_diamonds = cave->skeletons_worth_diamonds;
+
+ level->bd_expanding_wall_looks_like = CAVE_TO_LEVEL(cave->expanding_wall_looks_like);
+ level->bd_sand_looks_like = CAVE_TO_LEVEL(cave->dirt_looks_like);
+
+ level->bd_creatures_start_backwards = cave->creatures_backwards;
+ level->bd_creatures_turn_on_hatching = cave->creatures_direction_auto_change_on_start;
+ level->bd_creatures_auto_turn_delay = cave->creatures_direction_auto_change_time;
+
+ level->bd_gravity_direction = cave->gravity;
+ level->bd_gravity_switch_active = cave->gravity_switch_active;
+ level->bd_gravity_switch_delay = cave->gravity_change_time;
+ level->bd_gravity_affects_all = cave->gravity_affects_all;
+
+ level->bd_rock_turns_to_on_falling = CAVE_TO_LEVEL(cave->stone_falling_effect);
+ level->bd_rock_turns_to_on_impact = CAVE_TO_LEVEL(cave->stone_bouncing_effect);
+ level->bd_diamond_turns_to_on_falling = CAVE_TO_LEVEL(cave->diamond_falling_effect);
+ level->bd_diamond_turns_to_on_impact = CAVE_TO_LEVEL(cave->diamond_bouncing_effect);
+
+ level->bd_firefly_explodes_to = CAVE_TO_LEVEL(cave->firefly_explode_to);
+ level->bd_firefly_2_explodes_to = CAVE_TO_LEVEL(cave->alt_firefly_explode_to);
+ level->bd_butterfly_explodes_to = CAVE_TO_LEVEL(cave->butterfly_explode_to);
+ level->bd_butterfly_2_explodes_to = CAVE_TO_LEVEL(cave->alt_butterfly_explode_to);
+ level->bd_stonefly_explodes_to = CAVE_TO_LEVEL(cave->stonefly_explode_to);
+ level->bd_dragonfly_explodes_to = CAVE_TO_LEVEL(cave->dragonfly_explode_to);
+
+ level->bd_diamond_birth_turns_to = CAVE_TO_LEVEL(cave->diamond_birth_effect);
+ level->bd_bomb_explosion_turns_to = CAVE_TO_LEVEL(cave->bomb_explosion_effect);
+ level->bd_nitro_explosion_turns_to = CAVE_TO_LEVEL(cave->nitro_explosion_effect);
+ level->bd_explosion_turns_to = CAVE_TO_LEVEL(cave->explosion_effect);
+
+ // level name
+ char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
+
+ strncpy(level->name, cave_name, MAX_LEVEL_NAME_LEN);
+ level->name[MAX_LEVEL_NAME_LEN] = '\0';
+
+ // playfield elements
+ for (x = 0; x < level->fieldx; x++)
+ for (y = 0; y < level->fieldy; y++)
+ level->field[x][y] = CAVE_TO_LEVEL(cave->map[y][x]);
+
+ checked_free(cave_name);
+}
+
+static void setTapeInfoToDefaults(void);
+
+static void CopyNativeTape_BD_to_RND(struct LevelInfo *level)
+{
+ struct LevelInfo_BD *level_bd = level->native_bd_level;
+ GdCave *cave = level_bd->cave;
+ GdReplay *replay = level_bd->replay;
+ int i;
+
+ if (replay == NULL)
+ return;
+
+ // always start with reliable default values
+ setTapeInfoToDefaults();
+
+ tape.level_nr = level_nr; // (currently not used)
+ tape.random_seed = replay->seed;
+
+ TapeSetDateFromIsoDateString(replay->date);
+
+ tape.counter = 0;
+ tape.pos[tape.counter].delay = 0;
+
+ tape.bd_replay = TRUE;
+
+ // all time calculations only used to display approximate tape time
+ int cave_speed = cave->speed;
+ int milliseconds_game = 0;
+ int milliseconds_elapsed = 20;
+
+ for (i = 0; i < replay->movements->len; i++)
+ {
+ int replay_action = replay->movements->data[i];
+ int tape_action = map_action_BD_to_RND(replay_action);
+ byte action[MAX_TAPE_ACTIONS] = { tape_action };
+ boolean success = 0;
+
+ while (1)
+ {
+ success = TapeAddAction(action);
+
+ milliseconds_game += milliseconds_elapsed;
+
+ if (milliseconds_game >= cave_speed)
+ {
+ milliseconds_game -= cave_speed;
+
+ break;
+ }
+ }
+
+ tape.counter++;
+ tape.pos[tape.counter].delay = 0;
+ tape.pos[tape.counter].action[0] = 0;
+
+ if (!success)
+ {
+ Warn("BD replay truncated: size exceeds maximum tape size %d", MAX_TAPE_LEN);
+
+ break;
+ }
+ }
+
+ TapeHaltRecording();
+
+ if (!replay->success)
+ Warn("BD replay is marked as not successful");