1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 02:55:07 +00:00

Ensure Yamaha refresh program is used.

This commit is contained in:
Thomas Harte 2023-01-22 22:11:01 -05:00
parent 2744a9b6b0
commit 8567c934b1
2 changed files with 21 additions and 4 deletions

View File

@ -300,13 +300,22 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
break;
}
if(
const bool is_refresh =
(this->screen_mode_ == ScreenMode::Blank) ||
this->is_vertical_blank())
next_line_buffer.line_mode = LineMode::Refresh;
this->is_vertical_blank();
// TODO: an actual sprites-enabled flag.
Storage<personality>::begin_line(this->screen_mode_, next_line_buffer.line_mode == LineMode::Refresh, false);
Storage<personality>::begin_line(this->screen_mode_, is_refresh, false);
if(is_refresh) {
// The Yamaha handles refresh lines via its own microprogram; other VDPs
// can fall back on the regular refresh mechanic.
if constexpr (is_yamaha_vdp(personality)) {
next_line_buffer.line_mode = LineMode::Yamaha;
} else {
next_line_buffer.line_mode = LineMode::Refresh;
}
}
}
}

View File

@ -223,6 +223,14 @@ template <Personality personality> struct Storage<personality, std::enable_if_t<
}
}
#endif
// Seed to _something_ meaningful.
//
// TODO: this is a workaround [/hack], in effect, for the main TMS' habit of starting
// in a randomised position, which means that start-of-line isn't announced.
//
// Do I really want that behaviour?
next_event_ = refresh_events;
}
private: