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

Merge pull request #1316 from TomHarte/SMSScrolling

This commit is contained in:
Thomas Harte 2024-01-21 19:01:32 -05:00 committed by GitHub
commit 981f8a9aac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -222,13 +222,13 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
// Latch scrolling position, if necessary.
// ---------------------------------------
if constexpr (is_sega_vdp(personality)) {
if(!this->fetch_pointer_.row) {
// TODO: where did this magic constant come from? https://www.smspower.org/forums/17970-RoadRashHow#111000 mentioned in passing
// that "the vertical scroll register is latched at the start of the active display" and this is two clocks before that, so it's
// not uncompelling. I can just no longer find my source.
constexpr auto latch_time = LineLayout<personality>::EndOfLeftBorder - 2;
static_assert(latch_time > 0);
if(this->fetch_pointer_.column < latch_time && end_column >= latch_time) {
// TODO: where did this magic constant come from? https://www.smspower.org/forums/17970-RoadRashHow#111000 mentioned in passing
// that "the vertical scroll register is latched at the start of the active display" and this is two clocks before that, so it's
// not uncompelling. I can just no longer find my source.
constexpr auto latch_time = LineLayout<personality>::EndOfLeftBorder - 2;
static_assert(latch_time > 0);
if(this->fetch_pointer_.column < latch_time && end_column >= latch_time) {
if(!this->fetch_pointer_.row) {
Storage<personality>::latched_vertical_scroll_ = Storage<personality>::vertical_scroll_;
if(Storage<personality>::mode4_enable_) {