1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-09 15:39:08 +00:00

Followed tip: missiles are locked to the position after four output pixels, not four input pixels.

This commit is contained in:
Thomas Harte 2017-03-04 22:23:50 -05:00
parent 61b8fc1e2f
commit 79784a8e57

View File

@ -158,23 +158,24 @@ class TIA {
int reverse_mask; // 7 for a reflected player, 0 for normal
int graphic_index;
int pixel_position;
int pixel_position, pixel_counter;
int latched_pixel4_time;
const bool enqueues = true;
inline void skip_pixels(const int count, int from_horizontal_counter)
{
int old_pixel_position = pixel_position;
int old_pixel_counter = pixel_counter;
pixel_position = std::min(32, pixel_position + count * adder);
if(!copy_index_ && old_pixel_position < 16 && pixel_position >= 16)
pixel_counter += count;
if(!copy_index_ && old_pixel_counter < 4 && pixel_counter >= 4)
{
latched_pixel4_time = from_horizontal_counter + (16 - old_pixel_position) / adder;
latched_pixel4_time = from_horizontal_counter + 4 - old_pixel_counter;
}
}
inline void reset_pixels(int copy)
{
pixel_position = 0;
pixel_position = pixel_counter = 0;
copy_index_ = copy;
}