From 6440d92a341041dc543929b3fd5f6b4d52d6925b Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 19 Jun 2020 14:57:09 -0500 Subject: [PATCH] remove rewind frequency settings --- .../config/RewindConfig.cs | 7 - .../config/RewindConfig.Designer.cs | 158 +----------------- .../config/RewindConfig.cs | 57 +------ 3 files changed, 8 insertions(+), 214 deletions(-) diff --git a/src/BizHawk.Client.Common/config/RewindConfig.cs b/src/BizHawk.Client.Common/config/RewindConfig.cs index f7462ad941..77bc127574 100644 --- a/src/BizHawk.Client.Common/config/RewindConfig.cs +++ b/src/BizHawk.Client.Common/config/RewindConfig.cs @@ -6,9 +6,6 @@ public bool EnabledSmall { get; } public bool EnabledMedium { get; } public bool EnabledLarge { get; } - public int FrequencySmall { get; } - public int FrequencyMedium { get; } - public int FrequencyLarge { get; } public int BufferSize { get; } } @@ -18,10 +15,6 @@ public bool EnabledSmall { get; set; } = true; public bool EnabledMedium { get; set; } public bool EnabledLarge { get; set; } - public int FrequencySmall { get; set; } = 1; - public int FrequencyMedium { get; set; } = 4; - public int FrequencyLarge { get; set; } = 60; - public int BufferSize { get; set; } = 128; // in mb public int SpeedMultiplier { get; set; } = 1; } diff --git a/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs b/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs index 4419140349..7288044faa 100644 --- a/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs @@ -37,17 +37,8 @@ this.LargeStateEnabledBox = new System.Windows.Forms.CheckBox(); this.MediumStateEnabledBox = new System.Windows.Forms.CheckBox(); this.SmallStateEnabledBox = new System.Windows.Forms.CheckBox(); - this.LargeLabel2 = new System.Windows.Forms.Label(); - this.LargeLabel3 = new System.Windows.Forms.Label(); - this.LargeSavestateNumeric = new System.Windows.Forms.NumericUpDown(); this.LargeLabel = new System.Windows.Forms.Label(); - this.MediumLabel2 = new System.Windows.Forms.Label(); - this.MediumLabel3 = new System.Windows.Forms.Label(); - this.MediumSavestateNumeric = new System.Windows.Forms.NumericUpDown(); this.MediumLabel = new System.Windows.Forms.Label(); - this.SmallLabel2 = new System.Windows.Forms.Label(); - this.SmallLabel3 = new System.Windows.Forms.Label(); - this.SmallSavestateNumeric = new System.Windows.Forms.NumericUpDown(); this.UseCompression = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.StateSizeLabel = new System.Windows.Forms.Label(); @@ -89,9 +80,6 @@ this.BackupSavestatesCheckbox = new System.Windows.Forms.CheckBox(); this.label12 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.LargeSavestateNumeric)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.MediumSavestateNumeric)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.SmallSavestateNumeric)).BeginInit(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.RewindSpeedNumeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.BufferSizeUpDown)).BeginInit(); @@ -142,17 +130,8 @@ this.groupBox1.Controls.Add(this.LargeStateEnabledBox); this.groupBox1.Controls.Add(this.MediumStateEnabledBox); this.groupBox1.Controls.Add(this.SmallStateEnabledBox); - this.groupBox1.Controls.Add(this.LargeLabel2); - this.groupBox1.Controls.Add(this.LargeLabel3); - this.groupBox1.Controls.Add(this.LargeSavestateNumeric); this.groupBox1.Controls.Add(this.LargeLabel); - this.groupBox1.Controls.Add(this.MediumLabel2); - this.groupBox1.Controls.Add(this.MediumLabel3); - this.groupBox1.Controls.Add(this.MediumSavestateNumeric); this.groupBox1.Controls.Add(this.MediumLabel); - this.groupBox1.Controls.Add(this.SmallLabel2); - this.groupBox1.Controls.Add(this.SmallLabel3); - this.groupBox1.Controls.Add(this.SmallSavestateNumeric); this.groupBox1.Controls.Add(this.SmallLabel); this.groupBox1.Location = new System.Drawing.Point(12, 90); this.groupBox1.Name = "groupBox1"; @@ -200,47 +179,6 @@ this.SmallStateEnabledBox.UseVisualStyleBackColor = true; this.SmallStateEnabledBox.CheckStateChanged += new System.EventHandler(this.SmallStateEnabledBox_CheckStateChanged); // - // LargeLabel2 - // - this.LargeLabel2.AutoSize = true; - this.LargeLabel2.Location = new System.Drawing.Point(227, 88); - this.LargeLabel2.Name = "LargeLabel2"; - this.LargeLabel2.Size = new System.Drawing.Size(33, 13); - this.LargeLabel2.TabIndex = 13; - this.LargeLabel2.Text = "every"; - // - // LargeLabel3 - // - this.LargeLabel3.AutoSize = true; - this.LargeLabel3.Location = new System.Drawing.Point(307, 88); - this.LargeLabel3.Name = "LargeLabel3"; - this.LargeLabel3.Size = new System.Drawing.Size(38, 13); - this.LargeLabel3.TabIndex = 15; - this.LargeLabel3.Text = "frames"; - // - // LargeSavestateNumeric - // - this.LargeSavestateNumeric.Location = new System.Drawing.Point(263, 84); - this.LargeSavestateNumeric.Maximum = new decimal(new int[] { - 1024, - 0, - 0, - 0}); - this.LargeSavestateNumeric.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.LargeSavestateNumeric.Name = "LargeSavestateNumeric"; - this.LargeSavestateNumeric.Size = new System.Drawing.Size(38, 20); - this.LargeSavestateNumeric.TabIndex = 14; - this.LargeSavestateNumeric.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.LargeSavestateNumeric.ValueChanged += new System.EventHandler(this.LargeSavestateNumeric_ValueChanged); - // // LargeLabel1 // this.LargeLabel.AutoSize = true; @@ -251,47 +189,6 @@ this.LargeLabel.Text = "Large savestates (more than 100KB)"; this.LargeLabel.Click += new System.EventHandler(this.LargeLabel_Click); // - // MediumLabel2 - // - this.MediumLabel2.AutoSize = true; - this.MediumLabel2.Location = new System.Drawing.Point(227, 64); - this.MediumLabel2.Name = "MediumLabel2"; - this.MediumLabel2.Size = new System.Drawing.Size(33, 13); - this.MediumLabel2.TabIndex = 8; - this.MediumLabel2.Text = "every"; - // - // MediumLabel3 - // - this.MediumLabel3.AutoSize = true; - this.MediumLabel3.Location = new System.Drawing.Point(307, 64); - this.MediumLabel3.Name = "MediumLabel3"; - this.MediumLabel3.Size = new System.Drawing.Size(38, 13); - this.MediumLabel3.TabIndex = 10; - this.MediumLabel3.Text = "frames"; - // - // MediumSavestateNumeric - // - this.MediumSavestateNumeric.Location = new System.Drawing.Point(263, 60); - this.MediumSavestateNumeric.Maximum = new decimal(new int[] { - 1024, - 0, - 0, - 0}); - this.MediumSavestateNumeric.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.MediumSavestateNumeric.Name = "MediumSavestateNumeric"; - this.MediumSavestateNumeric.Size = new System.Drawing.Size(38, 20); - this.MediumSavestateNumeric.TabIndex = 9; - this.MediumSavestateNumeric.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.MediumSavestateNumeric.ValueChanged += new System.EventHandler(this.MediumSavestateNumeric_ValueChanged); - // // MediumLabel1 // this.MediumLabel.AutoSize = true; @@ -302,48 +199,7 @@ this.MediumLabel.Text = "Medium savestates (32 - 100KB)"; this.MediumLabel.Click += new System.EventHandler(this.MediumLabel_Click); // - // SmallLabel2 - // - this.SmallLabel2.AutoSize = true; - this.SmallLabel2.Location = new System.Drawing.Point(227, 40); - this.SmallLabel2.Name = "SmallLabel2"; - this.SmallLabel2.Size = new System.Drawing.Size(33, 13); - this.SmallLabel2.TabIndex = 3; - this.SmallLabel2.Text = "every"; - // - // SmallLabel3 - // - this.SmallLabel3.AutoSize = true; - this.SmallLabel3.Location = new System.Drawing.Point(307, 40); - this.SmallLabel3.Name = "SmallLabel3"; - this.SmallLabel3.Size = new System.Drawing.Size(38, 13); - this.SmallLabel3.TabIndex = 5; - this.SmallLabel3.Text = "frames"; - // - // SmallSavestateNumeric - // - this.SmallSavestateNumeric.Location = new System.Drawing.Point(263, 36); - this.SmallSavestateNumeric.Maximum = new decimal(new int[] { - 1024, - 0, - 0, - 0}); - this.SmallSavestateNumeric.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.SmallSavestateNumeric.Name = "SmallSavestateNumeric"; - this.SmallSavestateNumeric.Size = new System.Drawing.Size(38, 20); - this.SmallSavestateNumeric.TabIndex = 4; - this.SmallSavestateNumeric.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.SmallSavestateNumeric.ValueChanged += new System.EventHandler(this.SmallSavestateNumeric_ValueChanged); - // - // UseDeltaCompression + // UseCompression // this.UseCompression.AutoSize = true; this.UseCompression.Location = new System.Drawing.Point(16, 89); @@ -818,9 +674,6 @@ this.Load += new System.EventHandler(this.RewindConfig_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.LargeSavestateNumeric)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.MediumSavestateNumeric)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.SmallSavestateNumeric)).EndInit(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.RewindSpeedNumeric)).EndInit(); @@ -844,16 +697,7 @@ private System.Windows.Forms.Button Cancel; private System.Windows.Forms.Label SmallLabel; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Label SmallLabel2; - private System.Windows.Forms.Label SmallLabel3; - private System.Windows.Forms.NumericUpDown SmallSavestateNumeric; - private System.Windows.Forms.Label LargeLabel2; - private System.Windows.Forms.Label LargeLabel3; - private System.Windows.Forms.NumericUpDown LargeSavestateNumeric; private System.Windows.Forms.Label LargeLabel; - private System.Windows.Forms.Label MediumLabel2; - private System.Windows.Forms.Label MediumLabel3; - private System.Windows.Forms.NumericUpDown MediumSavestateNumeric; private System.Windows.Forms.Label MediumLabel; private System.Windows.Forms.Label label10; private System.Windows.Forms.CheckBox LargeStateEnabledBox; diff --git a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs index c9d02d1410..aa96605a01 100644 --- a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs @@ -14,7 +14,6 @@ namespace BizHawk.Client.EmuHawk private readonly IStatable _statableCore; private long _stateSize; - private int _stateSizeCategory = 1; // 1 = small, 2 = med, 3 = large // TODO: enum public RewindConfig(MainForm mainForm, Config config, IStatable statableCore) { @@ -43,10 +42,6 @@ namespace BizHawk.Client.EmuHawk UseCompression.Checked = _config.Rewind.UseCompression; - SmallSavestateNumeric.Value = _config.Rewind.FrequencySmall; - MediumSavestateNumeric.Value = _config.Rewind.FrequencyMedium; - LargeSavestateNumeric.Value = _config.Rewind.FrequencyLarge; - SmallStateEnabledBox.Checked = _config.Rewind.EnabledSmall; MediumStateEnabledBox.Checked = _config.Rewind.EnabledMedium; LargeStateEnabledBox.Checked = _config.Rewind.EnabledLarge; @@ -95,11 +90,10 @@ namespace BizHawk.Client.EmuHawk { StateSizeLabel.Text = FormatKB(_stateSize); - SmallLabel.Text = $"Small savestates"; - MediumLabel.Text = $"Medium savestates"; - LargeLabel.Text = $"Large savestates"; + SmallLabel.Text = "Small savestates"; + MediumLabel.Text = "Medium savestates"; + LargeLabel.Text = "Large savestates"; - _stateSizeCategory = 1; SmallLabel.Font = new Font(SmallLabel.Font, FontStyle.Italic); MediumLabel.Font = new Font(SmallLabel.Font, FontStyle.Regular); LargeLabel.Font = new Font(SmallLabel.Font, FontStyle.Regular); @@ -132,9 +126,6 @@ namespace BizHawk.Client.EmuHawk _config.Rewind.EnabledSmall = PutRewindSetting(_config.Rewind.EnabledSmall, SmallStateEnabledBox.Checked); _config.Rewind.EnabledMedium = PutRewindSetting(_config.Rewind.EnabledMedium, MediumStateEnabledBox.Checked); _config.Rewind.EnabledLarge = PutRewindSetting(_config.Rewind.EnabledLarge, LargeStateEnabledBox.Checked); - _config.Rewind.FrequencySmall = PutRewindSetting(_config.Rewind.FrequencySmall, (int)SmallSavestateNumeric.Value); - _config.Rewind.FrequencyMedium = PutRewindSetting(_config.Rewind.FrequencyMedium, (int)MediumSavestateNumeric.Value); - _config.Rewind.FrequencyLarge = PutRewindSetting(_config.Rewind.FrequencyLarge, (int)LargeSavestateNumeric.Value); _config.Rewind.BufferSize = PutRewindSetting(_config.Rewind.BufferSize, (int)BufferSizeUpDown.Value); // These settings are not used by DoRewindSettings @@ -158,23 +149,17 @@ namespace BizHawk.Client.EmuHawk private void SetSmallEnabled() { - SmallLabel.Enabled = SmallLabel2.Enabled - = SmallSavestateNumeric.Enabled = SmallLabel3.Enabled - = SmallStateEnabledBox.Checked; + SmallLabel.Enabled = SmallStateEnabledBox.Checked; } private void SetMediumEnabled() { - MediumLabel.Enabled = MediumLabel2.Enabled - = MediumSavestateNumeric.Enabled = MediumLabel3.Enabled - = MediumStateEnabledBox.Checked; + MediumLabel.Enabled = MediumStateEnabledBox.Checked; } private void SetLargeEnabled() { - LargeLabel.Enabled = LargeLabel2.Enabled - = LargeSavestateNumeric.Enabled = LargeLabel3.Enabled - = LargeStateEnabledBox.Checked; + LargeLabel.Enabled = LargeStateEnabledBox.Checked; } private void SmallStateEnabledBox_CheckStateChanged(object sender, EventArgs e) @@ -231,20 +216,7 @@ namespace BizHawk.Client.EmuHawk bufferSize *= 1024 * 1024; var estFrames = bufferSize / avgStateSize; - long estFrequency = 0; - switch (_stateSizeCategory) - { - case 1: - estFrequency = (long)SmallSavestateNumeric.Value; - break; - case 2: - estFrequency = (long)MediumSavestateNumeric.Value; - break; - case 3: - estFrequency = (long)LargeSavestateNumeric.Value; - break; - } - + long estFrequency = 0; // TODO long estTotalFrames = estFrames * estFrequency; double minutes = estTotalFrames / 60 / 60; @@ -263,21 +235,6 @@ namespace BizHawk.Client.EmuHawk CalculateEstimates(); } - private void SmallSavestateNumeric_ValueChanged(object sender, EventArgs e) - { - CalculateEstimates(); - } - - private void MediumSavestateNumeric_ValueChanged(object sender, EventArgs e) - { - CalculateEstimates(); - } - - private void LargeSavestateNumeric_ValueChanged(object sender, EventArgs e) - { - CalculateEstimates(); - } - private void NudCompression_ValueChanged(object sender, EventArgs e) { trackBarCompression.Value = (int)((NumericUpDown)sender).Value;