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

Switched explicitly to an accumulation model for filling the collision buffer.

This commit is contained in:
Thomas Harte 2017-02-06 21:59:28 -05:00
parent 8f5039130c
commit 944d835eea

View File

@ -386,6 +386,11 @@ void TIA::output_for_cycles(int number_of_cycles)
int output_cursor = horizontal_counter_; int output_cursor = horizontal_counter_;
horizontal_counter_ += number_of_cycles; horizontal_counter_ += number_of_cycles;
if(!output_cursor)
{
memset(collision_buffer_, 0, sizeof(collision_buffer_));
}
#define Period(function, target) \ #define Period(function, target) \
if(output_cursor < target) \ if(output_cursor < target) \
{ \ { \
@ -419,6 +424,8 @@ void TIA::output_for_cycles(int number_of_cycles)
break; break;
} }
#undef Period
if(output_mode_ & blank_flag) if(output_mode_ & blank_flag)
{ {
if(pixel_target_) if(pixel_target_)
@ -528,7 +535,7 @@ void TIA::draw_playfield(int start, int end)
while(position < end) while(position < end)
{ {
int offset = (position - first_pixel_cycle) >> 2; int offset = (position - first_pixel_cycle) >> 2;
collision_buffer_[position - first_pixel_cycle] = (background_[(offset/20)&background_half_mask_] >> (offset%20))&1; collision_buffer_[position - first_pixel_cycle] |= (background_[(offset/20)&background_half_mask_] >> (offset%20))&1;
position++; position++;
} }
} }