1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Disabled incorrect 'optimisations'.

This commit is contained in:
Thomas Harte 2017-02-19 12:00:04 -05:00
parent e00339ef0a
commit 51bcaea60c

View File

@ -654,8 +654,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
int adder = 4 >> player.size;
// perform a miniature event loop on (i) triggering draws; (ii) drawing; and (iii) motion
// if(is_moving_[position_identity] || player.graphic[player.graphic_index])
// {
int next_motion_time = motion_time_[position_identity] - first_pixel_cycle + 4;
while(start < end)
{
@ -669,8 +667,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
// is the next event a graphics trigger?
int next_copy = 160;
if(player.graphic[player.graphic_index])
{
if(position < 16 && player.copy_flags&1)
{
next_copy = 16;
@ -684,7 +680,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
int next_copy_time = start + next_copy - position;
if(next_copy_time < next_event_time) next_event_time = next_copy_time;
}
// the decision is to progress by length
const int length = next_event_time - start;
@ -692,6 +687,8 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
if(player.pixel_position < 32)
{
player.pixel_position &= ~(adder - 1);
if(player.graphic[player.graphic_index])
{
int output_cursor = 0;
while(player.pixel_position < 32 && output_cursor < length)
{
@ -701,6 +698,11 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
player.pixel_position += adder;
}
}
else
{
player.pixel_position = std::max(32, player.pixel_position + length * adder);
}
}
// the next interesting event is after next_event_time cycles, so progress
position = (position + length) % 160;
@ -714,19 +716,11 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
}
// if it's a draw trigger, trigger a draw
if(position == (next_copy % 160))
if(start == next_copy_time)
{
player.pixel_position = 0;
}
}
// }
// else
// {
// // just advance the timer all in one jump
// const int length = end - start;
// position = (position + length) % 160;
// player.pixel_position = std::min(32, player.pixel_position + adder * length);
// }
}
void TIA::draw_player(Player &player, CollisionType collision_identity, const int position_identity, int start, int end)