Tastudio - implement turboseek
This commit is contained in:
parent
8db6957e4a
commit
83d1e39db3
|
@ -94,6 +94,7 @@ namespace BizHawk.Client.Common
|
|||
public bool AVI_CaptureOSD = false;
|
||||
public bool Screenshot_CaptureOSD = false;
|
||||
public bool FirstBoot = true;
|
||||
public bool TurboSeek = true; // When PauseOnFrame is set, this will decide whether the client goes into turbo mode or not
|
||||
|
||||
public enum SaveStateTypeE { Default, Binary, Text };
|
||||
|
||||
|
@ -509,10 +510,10 @@ namespace BizHawk.Client.Common
|
|||
|
||||
// TAStudio Dialog
|
||||
public ToolDialogSettings TAStudioSettings = new ToolDialogSettings();
|
||||
public RecentFiles RecentTas = new RecentFiles(8);
|
||||
public bool AutoloadTAStudio = false;
|
||||
public bool AutoloadTAStudioProject = false;
|
||||
public bool TAStudioDrawInput = true;
|
||||
public RecentFiles RecentTas = new RecentFiles(8);
|
||||
|
||||
// VirtualPad Dialog
|
||||
public ToolDialogSettings VirtualPadSettings = new ToolDialogSettings();
|
||||
|
|
|
@ -556,7 +556,25 @@ namespace BizHawk.Client.EmuHawk
|
|||
public bool UpdateFrame = false;
|
||||
public bool EmulatorPaused { get; private set; }
|
||||
|
||||
public int? PauseOnFrame { get; set; } // If set, upon completion of this frame, the client wil pause
|
||||
private int? _pauseOnFrame;
|
||||
private bool _forceTurbo = false;
|
||||
public int? PauseOnFrame // If set, upon completion of this frame, the client wil pause
|
||||
{
|
||||
get { return _pauseOnFrame; }
|
||||
set
|
||||
{
|
||||
_pauseOnFrame = value;
|
||||
_forceTurbo = _pauseOnFrame.HasValue && Global.Config.TurboSeek;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTurboing
|
||||
{
|
||||
get
|
||||
{
|
||||
return Global.ClientControls["Turbo"] || _forceTurbo;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: SystemInfo should be able to do this
|
||||
// Because we don't have enough places where we list SystemID's
|
||||
|
@ -1560,7 +1578,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void SyncThrottle()
|
||||
{
|
||||
var fastforward = Global.ClientControls["Fast Forward"] || FastForward;
|
||||
var superfastforward = Global.ClientControls["Turbo"];
|
||||
var superfastforward = IsTurboing;
|
||||
Global.ForceNoThrottle = _unthrottled || fastforward;
|
||||
|
||||
// realtime throttle is never going to be so exact that using a double here is wrong
|
||||
|
@ -2532,8 +2550,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var coreskipaudio = false;
|
||||
if (runFrame)
|
||||
{
|
||||
var isFastForwarding = Global.ClientControls["Fast Forward"] || Global.ClientControls["Turbo"];
|
||||
var isTurboing = Global.ClientControls["Turbo"];
|
||||
var isFastForwarding = Global.ClientControls["Fast Forward"] || IsTurboing;
|
||||
var updateFpsString = _runloopLastFf != isFastForwarding;
|
||||
_runloopLastFf = isFastForwarding;
|
||||
|
||||
|
@ -2551,7 +2568,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.LuaConsole.LuaImp.CallFrameBeforeEvent();
|
||||
}
|
||||
|
||||
if (!isTurboing)
|
||||
if (!IsTurboing)
|
||||
{
|
||||
GlobalWin.Tools.UpdateToolsBefore();
|
||||
}
|
||||
|
@ -2575,7 +2592,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var fps_string = _runloopLastFps + " fps";
|
||||
if (isRewinding)
|
||||
{
|
||||
if (isTurboing || isFastForwarding)
|
||||
if (IsTurboing || isFastForwarding)
|
||||
{
|
||||
fps_string += " <<<<";
|
||||
}
|
||||
|
@ -2584,7 +2601,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
fps_string += " <<";
|
||||
}
|
||||
}
|
||||
else if (isTurboing)
|
||||
else if (IsTurboing)
|
||||
{
|
||||
fps_string += " >>>>";
|
||||
}
|
||||
|
@ -2612,7 +2629,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
Global.MovieSession.HandleMovieOnFrameLoop();
|
||||
|
||||
coreskipaudio = Global.ClientControls["Turbo"] && _currAviWriter == null;
|
||||
coreskipaudio = IsTurboing && _currAviWriter == null;
|
||||
|
||||
{
|
||||
bool render = !_throttle.skipnextframe || _currAviWriter != null;
|
||||
|
@ -2640,7 +2657,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.LuaConsole.LuaImp.CallFrameAfterEvent();
|
||||
}
|
||||
|
||||
if (!isTurboing)
|
||||
if (!IsTurboing)
|
||||
{
|
||||
UpdateToolsAfter();
|
||||
}
|
||||
|
@ -3303,6 +3320,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateDumpIcon();
|
||||
UpdateCoreStatusBarButton();
|
||||
ClearHolds();
|
||||
PauseOnFrame = null;
|
||||
_forceTurbo = false;
|
||||
ToolHelpers.UpdateCheatRelatedTools(null, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
{
|
||||
this.PlaybackGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.AutoRestoreCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.SeekProgressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.TurboSeekCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.FollowCursorCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.NextMarkerButton = new System.Windows.Forms.Button();
|
||||
|
@ -47,7 +46,6 @@
|
|||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.PlaybackGroupBox.Controls.Add(this.AutoRestoreCheckbox);
|
||||
this.PlaybackGroupBox.Controls.Add(this.SeekProgressBar);
|
||||
this.PlaybackGroupBox.Controls.Add(this.TurboSeekCheckbox);
|
||||
this.PlaybackGroupBox.Controls.Add(this.FollowCursorCheckbox);
|
||||
this.PlaybackGroupBox.Controls.Add(this.NextMarkerButton);
|
||||
|
@ -57,7 +55,7 @@
|
|||
this.PlaybackGroupBox.Controls.Add(this.PreviousMarkerButton);
|
||||
this.PlaybackGroupBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.PlaybackGroupBox.Name = "PlaybackGroupBox";
|
||||
this.PlaybackGroupBox.Size = new System.Drawing.Size(198, 114);
|
||||
this.PlaybackGroupBox.Size = new System.Drawing.Size(198, 90);
|
||||
this.PlaybackGroupBox.TabIndex = 0;
|
||||
this.PlaybackGroupBox.TabStop = false;
|
||||
this.PlaybackGroupBox.Text = "Playback";
|
||||
|
@ -66,32 +64,23 @@
|
|||
//
|
||||
this.AutoRestoreCheckbox.AutoSize = true;
|
||||
this.AutoRestoreCheckbox.Enabled = false;
|
||||
this.AutoRestoreCheckbox.Location = new System.Drawing.Point(10, 87);
|
||||
this.AutoRestoreCheckbox.Location = new System.Drawing.Point(10, 69);
|
||||
this.AutoRestoreCheckbox.Name = "AutoRestoreCheckbox";
|
||||
this.AutoRestoreCheckbox.Size = new System.Drawing.Size(141, 17);
|
||||
this.AutoRestoreCheckbox.TabIndex = 8;
|
||||
this.AutoRestoreCheckbox.Text = "Auto-restore last position";
|
||||
this.AutoRestoreCheckbox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// SeekProgressBar
|
||||
//
|
||||
this.SeekProgressBar.Enabled = false;
|
||||
this.SeekProgressBar.Location = new System.Drawing.Point(6, 71);
|
||||
this.SeekProgressBar.Name = "SeekProgressBar";
|
||||
this.SeekProgressBar.Size = new System.Drawing.Size(186, 10);
|
||||
this.SeekProgressBar.TabIndex = 7;
|
||||
this.SeekProgressBar.Value = 100;
|
||||
//
|
||||
// TurboSeekCheckbox
|
||||
//
|
||||
this.TurboSeekCheckbox.AutoSize = true;
|
||||
this.TurboSeekCheckbox.Enabled = false;
|
||||
this.TurboSeekCheckbox.Location = new System.Drawing.Point(103, 48);
|
||||
this.TurboSeekCheckbox.Name = "TurboSeekCheckbox";
|
||||
this.TurboSeekCheckbox.Size = new System.Drawing.Size(80, 17);
|
||||
this.TurboSeekCheckbox.TabIndex = 6;
|
||||
this.TurboSeekCheckbox.Text = "Turbo seek";
|
||||
this.TurboSeekCheckbox.UseVisualStyleBackColor = true;
|
||||
this.TurboSeekCheckbox.CheckedChanged += new System.EventHandler(this.TurboSeekCheckbox_CheckedChanged);
|
||||
//
|
||||
// FollowCursorCheckbox
|
||||
//
|
||||
|
@ -160,7 +149,7 @@
|
|||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.PlaybackGroupBox);
|
||||
this.Name = "PlaybackBox";
|
||||
this.Size = new System.Drawing.Size(204, 120);
|
||||
this.Size = new System.Drawing.Size(204, 96);
|
||||
this.PlaybackGroupBox.ResumeLayout(false);
|
||||
this.PlaybackGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
@ -176,7 +165,6 @@
|
|||
private System.Windows.Forms.Button RewindButton;
|
||||
private System.Windows.Forms.Button PreviousMarkerButton;
|
||||
private System.Windows.Forms.CheckBox AutoRestoreCheckbox;
|
||||
private System.Windows.Forms.ProgressBar SeekProgressBar;
|
||||
private System.Windows.Forms.CheckBox TurboSeekCheckbox;
|
||||
private System.Windows.Forms.CheckBox FollowCursorCheckbox;
|
||||
}
|
||||
|
|
|
@ -15,9 +15,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public TAStudio Tastudio { get; set; }
|
||||
|
||||
public bool TurboSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return Global.Config.TurboSeek;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
TurboSeekCheckbox.Checked = Global.Config.TurboSeek = value;
|
||||
}
|
||||
}
|
||||
|
||||
public PlaybackBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
TurboSeekCheckbox.Checked = Global.Config.TurboSeek;
|
||||
}
|
||||
|
||||
private void PreviousMarkerButton_Click(object sender, EventArgs e)
|
||||
|
@ -44,5 +58,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
Tastudio.GoToNextMarker();
|
||||
}
|
||||
|
||||
private void TurboSeekCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.TurboSeek ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -686,18 +686,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.TasView.ItemCount = 0;
|
||||
this.TasView.Location = new System.Drawing.Point(8, 27);
|
||||
this.TasView.Name = "TasView";
|
||||
this.TasView.RightButtonHeld = false;
|
||||
this.TasView.SelectAllInProgress = false;
|
||||
this.TasView.selectedItem = -1;
|
||||
this.TasView.Size = new System.Drawing.Size(288, 471);
|
||||
this.TasView.TabIndex = 1;
|
||||
this.TasView.UseCompatibleStateImageBehavior = false;
|
||||
this.TasView.View = System.Windows.Forms.View.Details;
|
||||
this.TasView.RightMouseScrolled += new BizHawk.Client.EmuHawk.TasListView.RightMouseScrollEventHandler(this.TasView_MouseWheel);
|
||||
this.TasView.SelectedIndexChanged += new System.EventHandler(this.TasView_SelectedIndexChanged);
|
||||
this.TasView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TasView_KeyDown);
|
||||
this.TasView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDoubleClick);
|
||||
this.TasView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDown);
|
||||
this.TasView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseUp);
|
||||
this.TasView.RightMouseScrolled += new TasListView.RightMouseScrollEventHandler(this.TasView_MouseWheel);
|
||||
//
|
||||
// Frame
|
||||
//
|
||||
|
@ -738,14 +739,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.TasPlaybackBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.TasPlaybackBox.Location = new System.Drawing.Point(302, 25);
|
||||
this.TasPlaybackBox.Name = "TasPlaybackBox";
|
||||
this.TasPlaybackBox.Size = new System.Drawing.Size(204, 120);
|
||||
this.TasPlaybackBox.Size = new System.Drawing.Size(204, 98);
|
||||
this.TasPlaybackBox.TabIndex = 5;
|
||||
this.TasPlaybackBox.Tastudio = null;
|
||||
//
|
||||
// MarkerControl
|
||||
//
|
||||
this.MarkerControl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.MarkerControl.Location = new System.Drawing.Point(302, 151);
|
||||
this.MarkerControl.Location = new System.Drawing.Point(302, 129);
|
||||
this.MarkerControl.Markers = null;
|
||||
this.MarkerControl.Name = "MarkerControl";
|
||||
this.MarkerControl.Size = new System.Drawing.Size(204, 215);
|
||||
|
|
Loading…
Reference in New Issue