mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-27 06:35:04 +00:00
Started communicating which copy is being requested.
This commit is contained in:
parent
98376de9ad
commit
440467ea3e
@ -381,7 +381,7 @@ void TIA::set_ball_position()
|
||||
ball_.position = 0;
|
||||
|
||||
// setting the ball position also triggers a draw
|
||||
ball_.reset_pixels();
|
||||
ball_.reset_pixels(0);
|
||||
}
|
||||
|
||||
void TIA::set_ball_motion(uint8_t motion)
|
||||
@ -638,10 +638,10 @@ template<class T> void TIA::perform_motion_step(T &object)
|
||||
object.is_moving = false;
|
||||
else
|
||||
{
|
||||
if(object.position == 159) object.reset_pixels();
|
||||
else if(object.position == 15 && object.copy_flags&1) object.reset_pixels();
|
||||
else if(object.position == 31 && object.copy_flags&2) object.reset_pixels();
|
||||
else if(object.position == 63 && object.copy_flags&4) object.reset_pixels();
|
||||
if(object.position == 159) object.reset_pixels(0);
|
||||
else if(object.position == 15 && object.copy_flags&1) object.reset_pixels(1);
|
||||
else if(object.position == 31 && object.copy_flags&2) object.reset_pixels(2);
|
||||
else if(object.position == 63 && object.copy_flags&4) object.reset_pixels(3);
|
||||
else object.skip_pixels(1);
|
||||
object.position = (object.position + 1) % 160;
|
||||
object.motion_step --;
|
||||
@ -701,17 +701,21 @@ template<class T> void TIA::draw_object_visible(T &object, const uint8_t collisi
|
||||
|
||||
// is the next event a graphics trigger?
|
||||
int next_copy = 160;
|
||||
int next_copy_id = 0;
|
||||
if(object.copy_flags)
|
||||
{
|
||||
if(object.position < 16 && object.copy_flags&1)
|
||||
{
|
||||
next_copy = 16;
|
||||
next_copy_id = 1;
|
||||
} else if(object.position < 32 && object.copy_flags&2)
|
||||
{
|
||||
next_copy = 32;
|
||||
next_copy_id = 2;
|
||||
} else if(object.position < 64 && object.copy_flags&4)
|
||||
{
|
||||
next_copy = 64;
|
||||
next_copy_id = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@ -755,7 +759,7 @@ template<class T> void TIA::draw_object_visible(T &object, const uint8_t collisi
|
||||
// if it's a draw trigger, trigger a draw
|
||||
else if(start == next_copy_time)
|
||||
{
|
||||
object.reset_pixels();
|
||||
object.reset_pixels(next_copy_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ class TIA {
|
||||
pixel_position = std::min(32, pixel_position + count * adder);
|
||||
}
|
||||
|
||||
inline void reset_pixels()
|
||||
inline void reset_pixels(int copy)
|
||||
{
|
||||
pixel_position = 0;
|
||||
}
|
||||
@ -245,7 +245,7 @@ class TIA {
|
||||
pixel_position = std::max(0, pixel_position - count);
|
||||
}
|
||||
|
||||
inline void reset_pixels()
|
||||
inline void reset_pixels(int copy)
|
||||
{
|
||||
pixel_position = size;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user