From eb3c11c672d0de7c93aac44499b6ce939e63998b Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Mon, 2 Dec 2019 20:50:51 +0000 Subject: [PATCH] Add option for 50Hz video. Signed-off-by: Andrea Odetti --- source/frontends/qapple/options.cpp | 7 ++++++- source/frontends/qapple/options.h | 1 + source/frontends/qapple/preferences.cpp | 3 +++ source/frontends/qapple/preferences.ui | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/frontends/qapple/options.cpp b/source/frontends/qapple/options.cpp index 2df91208..e14ba516 100644 --- a/source/frontends/qapple/options.cpp +++ b/source/frontends/qapple/options.cpp @@ -213,6 +213,7 @@ void getAppleWinPreferences(PreferenceData & data) data.videoType = GetVideoType(); data.scanLines = IsVideoStyle(VS_HALF_SCANLINES); data.verticalBlend = IsVideoStyle(VS_COLOR_VERTICAL_BLEND); + data.hz50 = GetVideoRefreshRate() == VR_50HZ; } void setAppleWinPreferences(const PreferenceData & currentData, const PreferenceData & newData) @@ -271,7 +272,8 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference RegSaveString(TEXT(REG_CONFIG), REGVALUE_SAVESTATE_FILENAME, 1, name); } - if (currentData.videoType != newData.videoType || currentData.scanLines != newData.scanLines || currentData.verticalBlend != newData.verticalBlend) + if (currentData.videoType != newData.videoType || currentData.scanLines != newData.scanLines || currentData.verticalBlend != newData.verticalBlend + || currentData.hz50 != newData.hz50) { const VideoType_e videoType = VideoType_e(newData.videoType); SetVideoType(videoType); @@ -283,6 +285,9 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference videoStyle = VideoStyle_e(videoStyle | VS_COLOR_VERTICAL_BLEND); SetVideoStyle(videoStyle); + const VideoRefreshRate_e videoRefreshRate = newData.hz50 ? VR_50HZ : VR_60HZ; + SetVideoRefreshRate(videoRefreshRate); + Config_Save_Video(); VideoReinitialize(); VideoRedrawScreen(); diff --git a/source/frontends/qapple/options.h b/source/frontends/qapple/options.h index 5bd9a338..73875bfd 100644 --- a/source/frontends/qapple/options.h +++ b/source/frontends/qapple/options.h @@ -33,6 +33,7 @@ struct PreferenceData bool mouseInSlot4; bool cpmInSlot5; bool hdInSlot7; + bool hz50; bool enhancedSpeed; diff --git a/source/frontends/qapple/preferences.cpp b/source/frontends/qapple/preferences.cpp index f4449bff..e2e4a90a 100644 --- a/source/frontends/qapple/preferences.cpp +++ b/source/frontends/qapple/preferences.cpp @@ -198,6 +198,8 @@ void Preferences::setData(const PreferenceData & data) ui->video_type->setCurrentIndex(data.videoType); ui->scan_lines->setChecked(data.scanLines); ui->vertical_blend->setChecked(data.verticalBlend); + + ui->hz_50->setChecked(data.hz50); } PreferenceData Preferences::getData() const @@ -233,6 +235,7 @@ PreferenceData Preferences::getData() const data.videoType = ui->video_type->currentIndex(); data.scanLines = ui->scan_lines->isChecked(); data.verticalBlend = ui->vertical_blend->isChecked(); + data.hz50 = ui->hz_50->isChecked(); return data; } diff --git a/source/frontends/qapple/preferences.ui b/source/frontends/qapple/preferences.ui index 72323086..cb221b79 100644 --- a/source/frontends/qapple/preferences.ui +++ b/source/frontends/qapple/preferences.ui @@ -498,6 +498,13 @@ + + + + 50 Hz + + +