1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Adopt proper pixel-content placement.

This commit is contained in:
Thomas Harte 2023-04-23 22:18:36 -04:00
parent f5c8eba843
commit 5daec050dd
2 changed files with 13 additions and 17 deletions

View File

@ -369,8 +369,8 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
}
// Based on the output mode, pick a line mode.
this->fetch_line_buffer_->first_pixel_output_column = Timing<personality>::FirstPixelCycle;
this->fetch_line_buffer_->next_border_column = Timing<personality>::CyclesPerLine;
this->fetch_line_buffer_->first_pixel_output_column = LineLayout<personality>::EndOfLeftBorder;
this->fetch_line_buffer_->next_border_column = LineLayout<personality>::EndOfPixels;
this->fetch_line_buffer_->pixel_count = 256;
this->fetch_line_buffer_->screen_mode = this->screen_mode_;
this->mode_timing_.maximum_visible_sprites = 4;
@ -381,14 +381,14 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
} else {
this->fetch_line_buffer_->fetch_mode = FetchMode::Text;
}
this->fetch_line_buffer_->first_pixel_output_column = Timing<personality>::FirstTextCycle;
this->fetch_line_buffer_->next_border_column = Timing<personality>::LastTextCycle;
this->fetch_line_buffer_->first_pixel_output_column = LineLayout<personality>::TextModeEndOfLeftBorder;
this->fetch_line_buffer_->next_border_column = LineLayout<personality>::TextModeEndOfPixels;
this->fetch_line_buffer_->pixel_count = 240;
break;
case ScreenMode::YamahaText80:
this->fetch_line_buffer_->fetch_mode = FetchMode::Yamaha;
this->fetch_line_buffer_->first_pixel_output_column = Timing<personality>::FirstTextCycle;
this->fetch_line_buffer_->next_border_column = Timing<personality>::LastTextCycle;
this->fetch_line_buffer_->first_pixel_output_column = LineLayout<personality>::TextModeEndOfLeftBorder;
this->fetch_line_buffer_->next_border_column = LineLayout<personality>::TextModeEndOfPixels;
this->fetch_line_buffer_->pixel_count = 480;
break;
@ -1200,7 +1200,7 @@ VerticalState Base<personality>::vertical_state() const {
template <Personality personality>
bool Base<personality>::is_horizontal_blank() const {
return fetch_pointer_.column < StandardTiming<personality>::FirstPixelCycle;
return fetch_pointer_.column < LineLayout<personality>::EndOfLeftErase || fetch_pointer_.column >= LineLayout<personality>::EndOfRightBorder;
}
template <Personality personality>

View File

@ -60,16 +60,6 @@ template <Personality personality> struct StandardTiming {
/// The number of internal cycles that must elapse between a request to read or write and
/// it becoming a candidate for action.
constexpr static int VRAMAccessDelay = 6;
/// The first internal cycle at which pixels will be output in any mode other than text.
/// Pixels implicitly run from here to the end of the line.
constexpr static int FirstPixelCycle = 86 * CyclesPerLine / 342;
/// The first internal cycle at which pixels will be output text mode.
constexpr static int FirstTextCycle = 94 * CyclesPerLine / 342;
/// The final internal cycle at which pixels will be output text mode.
constexpr static int LastTextCycle = 334 * CyclesPerLine / 342;
};
/// Provides concrete, specific timing for the nominated personality.
@ -183,6 +173,9 @@ template <Personality personality> struct LineLayout<personality, std::enable_if
constexpr static int EndOfLeftBorder = 63;
constexpr static int EndOfPixels = 319;
constexpr static int EndOfRightBorder = 334;
constexpr static int TextModeEndOfLeftBorder = 69;
constexpr static int TextModeEndOfPixels = 309;
};
template <Personality personality> struct LineLayout<personality, std::enable_if_t<is_yamaha_vdp(personality)>> {
@ -193,6 +186,9 @@ template <Personality personality> struct LineLayout<personality, std::enable_if
constexpr static int EndOfLeftBorder = 258;
constexpr static int EndOfPixels = 1282;
constexpr static int EndOfRightBorder = 1341;
constexpr static int TextModeEndOfLeftBorder = 294;
constexpr static int TextModeEndOfPixels = 1254;
};
}