From fe7a1add99e252ccfc9edda0af64492692d7df85 Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 14 Mar 2019 15:29:13 -0400 Subject: [PATCH] Video: Added integer (60.0 vs 60.1) FPS mode --- Core/Console.cpp | 4 ++-- UI/Forms/Config/frmVideoConfig.Designer.cs | 20 +------------------- UI/Forms/Config/frmVideoConfig.cs | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Core/Console.cpp b/Core/Console.cpp index db1b99b..ad3d371 100644 --- a/Core/Console.cpp +++ b/Core/Console.cpp @@ -258,8 +258,8 @@ double Console::GetFrameDelay() } else { UpdateRegion(); switch(_region) { - case ConsoleRegion::Ntsc: frameDelay = 16.63926405550947; break; - case ConsoleRegion::Pal: frameDelay = 19.99720882631146; break; + case ConsoleRegion::Ntsc: frameDelay = _settings->GetVideoConfig().IntegerFpsMode ? 16.6666666666666666667 : 16.63926405550947; break; + case ConsoleRegion::Pal: frameDelay = _settings->GetVideoConfig().IntegerFpsMode ? 20 : 19.99720882631146; break; } frameDelay /= (emulationSpeed / 100.0); } diff --git a/UI/Forms/Config/frmVideoConfig.Designer.cs b/UI/Forms/Config/frmVideoConfig.Designer.cs index d6116a0..e2b7abb 100644 --- a/UI/Forms/Config/frmVideoConfig.Designer.cs +++ b/UI/Forms/Config/frmVideoConfig.Designer.cs @@ -41,7 +41,6 @@ this.lblCustomRatio = new System.Windows.Forms.Label(); this.nudCustomRatio = new Mesen.GUI.Controls.MesenNumericUpDown(); this.chkFullscreenForceIntegerScale = new System.Windows.Forms.CheckBox(); - this.chkShowFps = new System.Windows.Forms.CheckBox(); this.chkIntegerFpsMode = new System.Windows.Forms.CheckBox(); this.flpRefreshRate = new System.Windows.Forms.FlowLayoutPanel(); this.lblRequestedRefreshRate = new System.Windows.Forms.Label(); @@ -133,15 +132,13 @@ this.tlpMain.Controls.Add(this.nudScale, 1, 0); this.tlpMain.Controls.Add(this.flowLayoutPanel6, 1, 1); this.tlpMain.Controls.Add(this.chkFullscreenForceIntegerScale, 0, 6); - this.tlpMain.Controls.Add(this.chkShowFps, 0, 7); this.tlpMain.Controls.Add(this.chkIntegerFpsMode, 0, 2); this.tlpMain.Controls.Add(this.flpRefreshRate, 0, 5); this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMain.Location = new System.Drawing.Point(3, 3); this.tlpMain.Margin = new System.Windows.Forms.Padding(0); this.tlpMain.Name = "tlpMain"; - this.tlpMain.RowCount = 9; - this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowCount = 8; this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -314,19 +311,6 @@ this.chkFullscreenForceIntegerScale.UseVisualStyleBackColor = true; this.chkFullscreenForceIntegerScale.Visible = false; // - // chkShowFps - // - this.chkShowFps.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.chkShowFps.AutoSize = true; - this.tlpMain.SetColumnSpan(this.chkShowFps, 2); - this.chkShowFps.Location = new System.Drawing.Point(3, 169); - this.chkShowFps.Name = "chkShowFps"; - this.chkShowFps.Size = new System.Drawing.Size(76, 17); - this.chkShowFps.TabIndex = 9; - this.chkShowFps.Text = "Show FPS"; - this.chkShowFps.UseVisualStyleBackColor = true; - this.chkShowFps.Visible = false; - // // chkIntegerFpsMode // this.chkIntegerFpsMode.Anchor = System.Windows.Forms.AnchorStyles.Left; @@ -338,7 +322,6 @@ this.chkIntegerFpsMode.TabIndex = 24; this.chkIntegerFpsMode.Text = "Enable integer FPS mode (e.g: run at 60 fps instead of 60.1)"; this.chkIntegerFpsMode.UseVisualStyleBackColor = true; - this.chkIntegerFpsMode.Visible = false; // // flpRefreshRate // @@ -863,7 +846,6 @@ private System.Windows.Forms.Label lblCustomRatio; private Controls.MesenNumericUpDown nudCustomRatio; private System.Windows.Forms.CheckBox chkFullscreenForceIntegerScale; - private System.Windows.Forms.CheckBox chkShowFps; private System.Windows.Forms.CheckBox chkIntegerFpsMode; private System.Windows.Forms.FlowLayoutPanel flpRefreshRate; private System.Windows.Forms.Label lblRequestedRefreshRate; diff --git a/UI/Forms/Config/frmVideoConfig.cs b/UI/Forms/Config/frmVideoConfig.cs index 00c843c..ed2439c 100644 --- a/UI/Forms/Config/frmVideoConfig.cs +++ b/UI/Forms/Config/frmVideoConfig.cs @@ -22,7 +22,6 @@ namespace Mesen.GUI.Forms.Config Entity = ConfigManager.Config.Video.Clone(); - //AddBinding(nameof(VideoConfig.ShowFPS), chkShowFps); AddBinding(nameof(VideoConfig.UseBilinearInterpolation), chkBilinearInterpolation); AddBinding(nameof(VideoConfig.VerticalSync), chkVerticalSync); AddBinding(nameof(VideoConfig.IntegerFpsMode), chkIntegerFpsMode);