cave->explosion_effect = non_scanned_pair(cave->explosion_effect);
cave->explosion_3_effect = non_scanned_pair(cave->explosion_3_effect);
}
+
+void update_cave_speed(GdCave *cave)
+{
+ // update timing calculated by iterating and counting elements which were slow to process on c64
+ switch (cave->scheduling)
+ {
+ case GD_SCHEDULING_MILLISECONDS:
+ // cave->speed already contains the milliseconds value, do not touch it
+ break;
+
+ case GD_SCHEDULING_BD1:
+ if (!cave->intermission)
+ {
+ // non-intermissions
+ cave->speed = (88 + 3.66 * cave->c64_timing +
+ (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000);
+ }
+ else
+ {
+ // intermissions were quicker, as only lines 1-12 were processed by the engine.
+ cave->speed = (60 + 3.66 * cave->c64_timing +
+ (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000);
+ }
+ break;
+
+ case GD_SCHEDULING_BD1_ATARI:
+ // about 20ms/frame faster than c64 version
+ if (!cave->intermission)
+ {
+ // non-intermissions
+ cave->speed = (74 + 3.2 * cave->c64_timing + (cave->ckdelay) / 1000);
+ }
+ else
+ {
+ // for intermissions
+ cave->speed = (65 + 2.88 * cave->c64_timing + (cave->ckdelay) / 1000);
+ }
+ break;
+
+ case GD_SCHEDULING_BD2:
+ // 60 is a guess.
+ cave->speed = MAX(60 + (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000,
+ cave->c64_timing * 20);
+ break;
+
+ case GD_SCHEDULING_PLCK:
+ // 65 is totally empty cave in construction kit, with delay = 0)
+ cave->speed = MAX(65 + cave->ckdelay / 1000, cave->c64_timing * 20);
+ break;
+
+ case GD_SCHEDULING_BD2_PLCK_ATARI:
+ // a really fast engine; timing works like c64 plck.
+ // 40 ms was measured in the construction kit, with delay = 0
+ cave->speed = MAX(40 + cave->ckdelay / 1000, cave->c64_timing * 20);
+ break;
+
+ case GD_SCHEDULING_CRDR:
+ if (cave->hammered_walls_reappear) // this made the engine very slow.
+ cave->ckdelay += 60000;
+ cave->speed = MAX(130 + cave->ckdelay / 1000, cave->c64_timing * 20);
+ break;
+
+ case GD_SCHEDULING_MAX:
+ break;
+ }
+}
store(cave, x, y, bouncing);
}
-static void update_cave_speed(GdCave *cave)
-{
- // update timing calculated by iterating and counting elements which were slow to process on c64
- switch (cave->scheduling)
- {
- case GD_SCHEDULING_MILLISECONDS:
- // cave->speed already contains the milliseconds value, do not touch it
- break;
-
- case GD_SCHEDULING_BD1:
- if (!cave->intermission)
- {
- // non-intermissions
- cave->speed = (88 + 3.66 * cave->c64_timing +
- (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000);
- }
- else
- {
- // intermissions were quicker, as only lines 1-12 were processed by the engine.
- cave->speed = (60 + 3.66 * cave->c64_timing +
- (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000);
- }
- break;
-
- case GD_SCHEDULING_BD1_ATARI:
- // about 20ms/frame faster than c64 version
- if (!cave->intermission)
- {
- // non-intermissions
- cave->speed = (74 + 3.2 * cave->c64_timing + (cave->ckdelay) / 1000);
- }
- else
- {
- // for intermissions
- cave->speed = (65 + 2.88 * cave->c64_timing + (cave->ckdelay) / 1000);
- }
- break;
-
- case GD_SCHEDULING_BD2:
- // 60 is a guess.
- cave->speed = MAX(60 + (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000,
- cave->c64_timing * 20);
- break;
-
- case GD_SCHEDULING_PLCK:
- // 65 is totally empty cave in construction kit, with delay = 0)
- cave->speed = MAX(65 + cave->ckdelay / 1000, cave->c64_timing * 20);
- break;
-
- case GD_SCHEDULING_BD2_PLCK_ATARI:
- // a really fast engine; timing works like c64 plck.
- // 40 ms was measured in the construction kit, with delay = 0
- cave->speed = MAX(40 + cave->ckdelay / 1000, cave->c64_timing * 20);
- break;
-
- case GD_SCHEDULING_CRDR:
- if (cave->hammered_walls_reappear) // this made the engine very slow.
- cave->ckdelay += 60000;
- cave->speed = MAX(130 + cave->ckdelay / 1000, cave->c64_timing * 20);
- break;
-
- case GD_SCHEDULING_MAX:
- break;
- }
-}
-
// Process a cave - one iteration.
//
// @param player_move The direction the player moves to.