1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Decline to provide synthetic text mode timing on the Mega Drive.

This commit is contained in:
Thomas Harte 2023-01-07 14:37:06 -05:00
parent dd5b4b484a
commit cdf547ac82
2 changed files with 15 additions and 6 deletions

View File

@ -265,7 +265,8 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
this->write_pointer_.row = (this->write_pointer_.row + 1) % this->mode_timing_.total_lines;
LineBuffer &next_line_buffer = this->line_buffers_[this->write_pointer_.row];
// Establish the output mode for the next line.
// Establish the current screen output mode, which will be captured as a
// line mode momentarily.
this->screen_mode_ = this->current_screen_mode();
// Based on the output mode, pick a line mode.
@ -274,9 +275,13 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
this->mode_timing_.maximum_visible_sprites = 4;
switch(this->screen_mode_) {
case ScreenMode::Text:
next_line_buffer.line_mode = LineMode::Text;
next_line_buffer.first_pixel_output_column = Timing<personality>::FirstTextCycle;
next_line_buffer.next_border_column = Timing<personality>::LastTextCycle;
if constexpr (Timing<personality>::SupportsTextMode) {
next_line_buffer.line_mode = LineMode::Text;
next_line_buffer.first_pixel_output_column = Timing<personality>::FirstTextCycle;
next_line_buffer.next_border_column = Timing<personality>::LastTextCycle;
} else {
next_line_buffer.line_mode = LineMode::Refresh;
}
break;
case ScreenMode::SMSMode4:
next_line_buffer.line_mode = LineMode::SMS;

View File

@ -31,6 +31,10 @@ struct Timing<personality, std::enable_if_t<is_classic_vdp(personality)>> {
/// Pixels implicitly run from here to the end of the line.
constexpr static int FirstPixelCycle = 86;
/// Indicates whether text modes are supported by this VDP. If so then
/// values for First & Last TextCycle are required. If not then they can be omitted.
constexpr static bool SupportsTextMode = true;
/// The first internal cycle at which pixels will be output text mode.
constexpr static int FirstTextCycle = 94;
@ -43,6 +47,7 @@ struct Timing<personality, std::enable_if_t<is_yamaha_vdp(personality)>> {
constexpr static int CyclesPerLine = 1368;
constexpr static int VRAMAccessDelay = 6;
constexpr static int FirstPixelCycle = 344;
constexpr static bool SupportsTextMode = true;
constexpr static int FirstTextCycle = 376;
constexpr static int LastTextCycle = 1336;
};
@ -52,8 +57,7 @@ struct Timing<Personality::MDVDP> {
constexpr static int CyclesPerLine = 3420;
constexpr static int VRAMAccessDelay = 6;
constexpr static int FirstPixelCycle = 860;
constexpr static int FirstTextCycle = 940;
constexpr static int LastTextCycle = 3340;
constexpr static bool SupportsTextMode = false;
};
constexpr int TMSAccessWindowsPerLine = 171;