Options: Added option to automatically pause emulation when a movie finishes playing

This commit is contained in:
Souryo 2016-01-31 14:28:31 -05:00
parent 441d5e108d
commit a65907c440
6 changed files with 27 additions and 4 deletions

View file

@ -12,6 +12,7 @@ enum EmulationFlags
RemoveSpriteLimit = 0x10,
UseHdPacks = 0x20,
PauseOnMovieEnd = 0x0100,
PauseWhenInBackground = 0x0200,
AllowBackgroundInput = 0x0400,
ReduceSoundInBackground = 0x0800,

View file

@ -48,6 +48,9 @@ uint8_t Movie::GetState(uint8_t port)
//End of movie file
MessageManager::DisplayMessage("Movies", "Movie ended.");
MessageManager::SendNotification(ConsoleNotificationType::MovieEnded);
if(EmulationSettings::CheckFlag(EmulationFlags::PauseOnMovieEnd)) {
EmulationSettings::SetFlags(EmulationFlags::Paused);
}
_playing = false;
}

View file

@ -28,6 +28,8 @@ namespace Mesen.GUI.Config
public bool AssociateMmoFiles = false;
public bool AssociateMstFiles = false;
public bool PauseOnMovieEnd = true;
public bool UseAlternativeMmc3Irq = false;
public PreferenceInfo()
@ -63,7 +65,7 @@ namespace Mesen.GUI.Config
InteropEmu.SetFlag(EmulationFlags.RemoveSpriteLimit, preferenceInfo.RemoveSpriteLimit);
InteropEmu.SetFlag(EmulationFlags.FdsAutoLoadDisk, preferenceInfo.FdsAutoLoadDisk);
InteropEmu.SetFlag(EmulationFlags.FdsFastForwardOnLoad, preferenceInfo.FdsFastForwardOnLoad);
InteropEmu.SetFlag(EmulationFlags.PauseOnMovieEnd, preferenceInfo.PauseOnMovieEnd);
InteropEmu.SetFlag(EmulationFlags.AllowBackgroundInput, preferenceInfo.AllowBackgroundInput);
InteropEmu.SetFlag(EmulationFlags.PauseWhenInBackground, preferenceInfo.PauseWhenInBackground);
}

View file

@ -28,6 +28,7 @@
private void InitializeComponent()
{
this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
this.chkPauseOnMovieEnd = new System.Windows.Forms.CheckBox();
this.chkAllowBackgroundInput = new System.Windows.Forms.CheckBox();
this.chkPauseWhenInBackground = new System.Windows.Forms.CheckBox();
this.chkAutoLoadIps = new System.Windows.Forms.CheckBox();
@ -70,15 +71,17 @@
//
this.tlpMain.ColumnCount = 1;
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tlpMain.Controls.Add(this.chkPauseOnMovieEnd, 0, 4);
this.tlpMain.Controls.Add(this.chkAllowBackgroundInput, 0, 3);
this.tlpMain.Controls.Add(this.chkPauseWhenInBackground, 0, 2);
this.tlpMain.Controls.Add(this.chkAutoLoadIps, 0, 1);
this.tlpMain.Controls.Add(this.flowLayoutPanel6, 0, 0);
this.tlpMain.Controls.Add(this.chkDisableScreensaver, 0, 4);
this.tlpMain.Controls.Add(this.chkDisableScreensaver, 0, 5);
this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpMain.Location = new System.Drawing.Point(3, 3);
this.tlpMain.Name = "tlpMain";
this.tlpMain.RowCount = 5;
this.tlpMain.RowCount = 6;
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());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -87,6 +90,16 @@
this.tlpMain.Size = new System.Drawing.Size(380, 207);
this.tlpMain.TabIndex = 1;
//
// chkPauseOnMovieEnd
//
this.chkPauseOnMovieEnd.AutoSize = true;
this.chkPauseOnMovieEnd.Location = new System.Drawing.Point(3, 95);
this.chkPauseOnMovieEnd.Name = "chkPauseOnMovieEnd";
this.chkPauseOnMovieEnd.Size = new System.Drawing.Size(199, 17);
this.chkPauseOnMovieEnd.TabIndex = 15;
this.chkPauseOnMovieEnd.Text = "Pause when a movie finishes playing";
this.chkPauseOnMovieEnd.UseVisualStyleBackColor = true;
//
// chkAllowBackgroundInput
//
this.chkAllowBackgroundInput.AutoSize = true;
@ -143,7 +156,7 @@
//
this.chkDisableScreensaver.AutoSize = true;
this.chkDisableScreensaver.Enabled = false;
this.chkDisableScreensaver.Location = new System.Drawing.Point(3, 95);
this.chkDisableScreensaver.Location = new System.Drawing.Point(3, 118);
this.chkDisableScreensaver.Name = "chkDisableScreensaver";
this.chkDisableScreensaver.Size = new System.Drawing.Size(245, 17);
this.chkDisableScreensaver.TabIndex = 11;
@ -392,5 +405,6 @@
private System.Windows.Forms.CheckBox chkFdsAutoLoadDisk;
private System.Windows.Forms.CheckBox chkFdsFastForwardOnLoad;
private System.Windows.Forms.CheckBox chkAllowBackgroundInput;
private System.Windows.Forms.CheckBox chkPauseOnMovieEnd;
}
}

View file

@ -35,6 +35,8 @@ namespace Mesen.GUI.Forms.Config
AddBinding("PauseWhenInBackground", chkPauseWhenInBackground);
AddBinding("AllowBackgroundInput", chkAllowBackgroundInput);
AddBinding("PauseOnMovieEnd", chkPauseOnMovieEnd);
}
protected override void OnFormClosed(FormClosedEventArgs e)

View file

@ -468,6 +468,7 @@ namespace Mesen.GUI
RemoveSpriteLimit = 0x10,
UseHdPacks = 0x20,
PauseOnMovieEnd = 0x0100,
PauseWhenInBackground = 0x0200,
AllowBackgroundInput = 0x0400,
ReduceSoundInBackground = 0x0800,