From c6ea3a374e930655a7c827b52111d520678698e5 Mon Sep 17 00:00:00 2001 From: joevt Date: Mon, 8 Apr 2024 16:15:56 -0700 Subject: [PATCH] control: Fix PAL/NTSC interlaced display. --- devices/video/control.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devices/video/control.cpp b/devices/video/control.cpp index 7b19df4..48308fb 100644 --- a/devices/video/control.cpp +++ b/devices/video/control.cpp @@ -586,6 +586,9 @@ void ControlVideo::enable_display() // set framebuffer parameters this->fb_ptr = &this->vram_ptr[this->fb_base]; this->fb_pitch = this->row_words; + if (~this->enables & SCAN_CONTROL) { + this->fb_pitch >>= 1; + } this->pixel_depth = this->radacal->get_pix_width(); if (swatch_params[ControlRegs::HAL-1] != swatch_params[ControlRegs::PIPE_DELAY-1] + 1 || this->pixel_depth == 32) { @@ -650,7 +653,10 @@ void ControlVideo::enable_display() // set up periodic timer for display updates if (this->active_width > 0 && this->active_height > 0 && this->pixel_clock > 0) { this->refresh_rate = (double)(this->pixel_clock) / (this->hori_total * this->vert_total); - LOG_F(INFO, "Control: refresh rate set to %f Hz", this->refresh_rate); + if (~this->enables & SCAN_CONTROL) { + this->refresh_rate *= 2; + } + LOG_F(INFO, "%s: refresh rate set to %f Hz", this->name.c_str(), this->refresh_rate); this->start_refresh_task();