From eb1d5d0a6da3c3e90043b786c0388138401042da Mon Sep 17 00:00:00 2001 From: joevt Date: Wed, 28 Feb 2024 01:55:54 -0800 Subject: [PATCH] atimach64gx: Make sure refresh rate is reasonable. --- devices/video/atimach64gx.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devices/video/atimach64gx.cpp b/devices/video/atimach64gx.cpp index c0254ad..f6b7631 100644 --- a/devices/video/atimach64gx.cpp +++ b/devices/video/atimach64gx.cpp @@ -548,6 +548,12 @@ void AtiMach64Gx::crtc_update() // calculate display refresh rate this->refresh_rate = this->pixel_clock / this->hori_total / this->vert_total; + if (this->refresh_rate < 24 || this->refresh_rate > 120) { + LOG_F(ERROR, "%s: Refresh rate is weird. Will try 60 Hz", this->name.c_str()); + this->refresh_rate = 60; + this->pixel_clock = this->refresh_rate * this->hori_total / this->vert_total; + } + // set up frame buffer converter switch (this->pixel_format) { case 2: