diff --git a/src/include/86box/video.h b/src/include/86box/video.h index a9e21acc8..3bf703099 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -139,6 +139,7 @@ typedef struct monitor_t { int mon_cga_palette_static; /* Whether it should not be freed by the API. */ const video_timings_t *mon_vid_timings; int mon_vid_type; + atomic_bool mon_interlace; struct blit_data_struct *mon_blit_data_ptr; } monitor_t; diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 8af112bda..7a6030e39 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -196,7 +196,7 @@ MainWindow::MainWindow(QWidget *parent) frameRateTimer->setInterval(1000); frameRateTimer->setSingleShot(false); connect(frameRateTimer, &QTimer::timeout, [this, hertz_label] { - hertz_label->setText(tr("%1 Hz").arg(monitors[0].mon_actualrenderedframes.load())); + hertz_label->setText(tr("%1 Hz").arg(QString::number(monitors[0].mon_actualrenderedframes.load()) + (monitors[0].mon_interlace ? "i" : ""))); }); statusBar()->addPermanentWidget(hertz_label); frameRateTimer->start(1000); diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index 96b286cfc..ade27d831 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -105,7 +105,7 @@ RendererStack::RendererStack(QWidget *parent, int monitor_index) frameRateTimer->setSingleShot(false); frameRateTimer->setInterval(1000); connect(frameRateTimer, &QTimer::timeout, [this] { - this->setWindowTitle(QObject::tr("86Box Monitor #") + QString::number(m_monitor_index + 1) + QString(" - ") + tr("%1 Hz").arg(monitors[m_monitor_index].mon_actualrenderedframes.load())); + this->setWindowTitle(QObject::tr("86Box Monitor #") + QString::number(m_monitor_index + 1) + QString(" - ") + tr("%1 Hz").arg(QString::number(monitors[m_monitor_index].mon_actualrenderedframes.load()) + (monitors[m_monitor_index].mon_interlace ? "i" : ""))); }); frameRateTimer->start(1000); } diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 2b9b612b2..21ea23c93 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1146,6 +1146,7 @@ svga_recalctimings(svga_t *svga) if (dev->dispofftime < TIMER_USEC) dev->dispofftime = TIMER_USEC; + svga->monitor->mon_interlace = !!dev->interlace; ibm8514_set_poll(svga); } else svga_set_poll(svga); @@ -1164,6 +1165,7 @@ svga_recalctimings(svga_t *svga) if (xga->dispofftime < TIMER_USEC) xga->dispofftime = TIMER_USEC; + svga->monitor->mon_interlace = !!xga->interlace; xga_set_poll(svga); } else svga_set_poll(svga); @@ -1182,6 +1184,7 @@ svga_recalctimings(svga_t *svga) if (dev->dispofftime < TIMER_USEC) dev->dispofftime = TIMER_USEC; + svga->monitor->mon_interlace = !!dev->interlace; ibm8514_set_poll(svga); } else if (xga->on) { _dispofftime_xga = disptime_xga - _dispontime_xga; @@ -1195,6 +1198,7 @@ svga_recalctimings(svga_t *svga) if (xga->dispofftime < TIMER_USEC) xga->dispofftime = TIMER_USEC; + svga->monitor->mon_interlace = !!xga->interlace; xga_set_poll(svga); } else svga_set_poll(svga); @@ -1247,6 +1251,10 @@ svga_recalctimings(svga_t *svga) else svga->hdisp >>= 1; } + + svga->monitor->mon_interlace = 0; + if (!svga->override && svga->interlace) + svga->monitor->mon_interlace = 1; } static void diff --git a/src/video/vid_table.c b/src/video/vid_table.c index 037f2a16c..6d3e70832 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -332,6 +332,8 @@ video_prepare(void) /* Do an inform on the default values, so that that there's some sane values initialized even if the device init function does not do an inform of its own. */ video_inform_monitor(VIDEO_FLAG_TYPE_SPECIAL, &timing_default, i); + + monitors[i].mon_interlace = 0; } }