Video: Added an option to disable frame skipping

This commit is contained in:
Sour 2019-07-18 19:33:37 -04:00
parent 2f7594936b
commit 3992486fa1
6 changed files with 20 additions and 1 deletions

View file

@ -462,6 +462,7 @@ bool Ppu::ProcessEndOfScanline(uint16_t hClock)
_console->ProcessEvent(EventType::StartFrame);
_skipRender = (
!_console->GetSettings()->GetVideoConfig().DisableFrameSkipping &&
!_console->GetRewindManager()->IsRewinding() &&
!_console->GetVideoRenderer()->IsRecording() &&
(_console->GetSettings()->GetEmulationSpeed() == 0 || _console->GetSettings()->GetEmulationSpeed() > 150) &&

View file

@ -80,6 +80,7 @@ struct VideoConfig
bool HideBgLayer2 = false;
bool HideBgLayer3 = false;
bool HideSprites = false;
bool DisableFrameSkipping = false;
double Brightness = 0;
double Contrast = 0;

View file

@ -24,6 +24,7 @@ namespace Mesen.GUI.Config
[MarshalAs(UnmanagedType.I1)] public bool HideBgLayer2 = false;
[MarshalAs(UnmanagedType.I1)] public bool HideBgLayer3 = false;
[MarshalAs(UnmanagedType.I1)] public bool HideSprites = false;
[MarshalAs(UnmanagedType.I1)] public bool DisableFrameSkipping = false;
[MinMax(-1, 1.0)] public double Brightness = 0;
[MinMax(-1, 1.0)] public double Contrast = 0;

View file

@ -263,6 +263,7 @@
<Control ID="chkHideBgLayer2">Hide background layer 2</Control>
<Control ID="chkHideBgLayer3">Hide background layer 3</Control>
<Control ID="chkHideSprites">Hide sprites</Control>
<Control ID="chkDisableFrameSkipping">Disable frame skipping when fast forwarding</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Cancel</Control>

View file

@ -98,6 +98,7 @@
this.mnuPresetSVideo = new System.Windows.Forms.ToolStripMenuItem();
this.mnuPresetRgb = new System.Windows.Forms.ToolStripMenuItem();
this.mnuPresetMonochrome = new System.Windows.Forms.ToolStripMenuItem();
this.chkDisableFrameSkipping = new Mesen.GUI.Controls.ctrlRiskyOption();
this.tabMain.SuspendLayout();
this.tpgGeneral.SuspendLayout();
this.tlpMain.SuspendLayout();
@ -1090,6 +1091,7 @@
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.chkDisableFrameSkipping, 0, 5);
this.tableLayoutPanel2.Controls.Add(this.chkHideBgLayer0, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.chkHideBgLayer1, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.chkHideBgLayer2, 0, 2);
@ -1098,7 +1100,8 @@
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 6;
this.tableLayoutPanel2.RowCount = 7;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -1196,6 +1199,16 @@
this.mnuPresetMonochrome.Text = "Monochrome";
this.mnuPresetMonochrome.Click += new System.EventHandler(this.mnuPresetMonochrome_Click);
//
// chkDisableFrameSkipping
//
this.chkDisableFrameSkipping.Checked = false;
this.chkDisableFrameSkipping.Dock = System.Windows.Forms.DockStyle.Top;
this.chkDisableFrameSkipping.Location = new System.Drawing.Point(0, 120);
this.chkDisableFrameSkipping.Name = "chkDisableFrameSkipping";
this.chkDisableFrameSkipping.Size = new System.Drawing.Size(560, 24);
this.chkDisableFrameSkipping.TabIndex = 5;
this.chkDisableFrameSkipping.Text = "Disable frame skipping when fast-forwarding";
//
// frmVideoConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1322,5 +1335,6 @@
private Controls.ctrlRiskyOption chkHideBgLayer2;
private Controls.ctrlRiskyOption chkHideBgLayer3;
private Controls.ctrlRiskyOption chkHideSprites;
private Controls.ctrlRiskyOption chkDisableFrameSkipping;
}
}

View file

@ -59,6 +59,7 @@ namespace Mesen.GUI.Forms.Config
AddBinding(nameof(VideoConfig.HideBgLayer2), chkHideBgLayer2);
AddBinding(nameof(VideoConfig.HideBgLayer3), chkHideBgLayer3);
AddBinding(nameof(VideoConfig.HideSprites), chkHideSprites);
AddBinding(nameof(VideoConfig.DisableFrameSkipping), chkDisableFrameSkipping);
UpdateOverscanImage(picOverscan, 0, 0, 0, 0);
}