diff --git a/Machines/Atari2600/TIA.cpp b/Machines/Atari2600/TIA.cpp index e8692b24d..f999285db 100644 --- a/Machines/Atari2600/TIA.cpp +++ b/Machines/Atari2600/TIA.cpp @@ -351,6 +351,7 @@ void TIA::set_ball_motion(uint8_t motion) void TIA::move() { + horizontal_blank_extend_ = true; } void TIA::clear_motion() @@ -389,9 +390,10 @@ void TIA::output_for_cycles(int number_of_cycles) if(!output_cursor) { memset(collision_buffer_, 0, sizeof(collision_buffer_)); + horizontal_blank_extend_ = false; } - // accumulate an OR'dversion of the output into the collision buffer + // accumulate an OR'd version of the output into the collision buffer draw_playfield(output_cursor, horizontal_counter_); // convert to television signals @@ -476,6 +478,16 @@ void TIA::output_pixels(int start, int end) { int target_position = start - pixels_start_location_; + if(start < first_pixel_cycle+8 && horizontal_blank_extend_) + { + while(start < end && start < first_pixel_cycle+8) + { + pixel_target_[target_position] = 0; + start++; + target_position++; + } + } + if(playfield_priority_ == PlayfieldPriority::Score) { while(start < end && start < first_pixel_cycle + 80) @@ -519,12 +531,14 @@ void TIA::output_line() crt_->output_sync(32); crt_->output_blank(32); crt_->output_sync(392); + horizontal_blank_extend_ = false; break; case blank_flag: crt_->output_blank(32); crt_->output_sync(32); crt_->output_default_colour_burst(32); crt_->output_blank(360); + horizontal_blank_extend_ = false; break; } } diff --git a/Machines/Atari2600/TIA.hpp b/Machines/Atari2600/TIA.hpp index e25ccddf5..a7c310475 100644 --- a/Machines/Atari2600/TIA.hpp +++ b/Machines/Atari2600/TIA.hpp @@ -153,6 +153,9 @@ class TIA { struct Missile { int size; // 0 = 1 pixel, 1 = 2 pixels, etc } missile_[2]; + + // movement + bool horizontal_blank_extend_; }; }