Add Rewind Settings dialog and remove the old Rewind enable menu item. New dialog let's the user set the rewind frequency and/or enable/disable rewind for small, medium, and large savestates separately

This commit is contained in:
adelikat 2013-07-21 20:39:11 +00:00
parent 55471ce891
commit 77a4eb098f
12 changed files with 692 additions and 77 deletions

View File

@ -206,6 +206,10 @@
<DependentUpon>PathInfo.cs</DependentUpon>
</Compile>
<Compile Include="config\PathManager.cs" />
<Compile Include="config\RewindConfig.cs" />
<Compile Include="config\RewindConfig.Designer.cs">
<DependentUpon>RewindConfig.cs</DependentUpon>
</Compile>
<Compile Include="config\SoundConfig.cs">
<SubType>Form</SubType>
</Compile>
@ -588,6 +592,9 @@
<EmbeddedResource Include="config\PathInfo.resx">
<DependentUpon>PathInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="config\RewindConfig.resx">
<DependentUpon>RewindConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GBAtools\GBAGPUView.resx">
<DependentUpon>GBAGPUView.cs</DependentUpon>
</EmbeddedResource>

View File

@ -208,6 +208,12 @@
<DependentUpon>PathInfo.cs</DependentUpon>
</Compile>
<Compile Include="config\PathManager.cs" />
<Compile Include="config\RewindConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="config\RewindConfig.Designer.cs">
<DependentUpon>RewindConfig.cs</DependentUpon>
</Compile>
<Compile Include="config\SoundConfig.cs">
<SubType>Form</SubType>
</Compile>
@ -590,6 +596,9 @@
<EmbeddedResource Include="config\PathInfo.resx">
<DependentUpon>PathInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="config\RewindConfig.resx">
<DependentUpon>RewindConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GBAtools\GBAGPUView.resx">
<DependentUpon>GBAGPUView.cs</DependentUpon>
</EmbeddedResource>

View File

@ -224,7 +224,16 @@ namespace BizHawk.MultiClient
public bool ClockThrottle = true;
public bool AutoMinimizeSkipping = true;
public bool VSyncThrottle = false;
public bool RewindEnabled = true;
//Rewind settings
public bool RewindEnabledSmall = true;
public bool RewindEnabledMedium = true;
public bool RewindEnabledLarge = true;
public int RewindFrequencySmall = 1;
public int RewindFrequencyMedium = 2;
public int RewindFrequencyLarge = 60;
/// <summary>use vsync. if VSyncThrottle = false, this will try to use vsync without throttling to it</summary>
public bool VSync = false;

View File

@ -1208,13 +1208,14 @@ namespace BizHawk.MultiClient
{
if (temp == "0" || temp.ToLower() == "false")
{
Global.Config.RewindEnabled = false;
Global.MainForm.RewindActive = false;
Global.OSD.AddMessage("Rewind suspended");
}
else
{
Global.Config.RewindEnabled = true;
Global.MainForm.RewindActive = true;
Global.OSD.AddMessage("Rewind enabled");
}
Global.MainForm.RewindMessage();
}
}
@ -2233,21 +2234,20 @@ namespace BizHawk.MultiClient
{
foreach (var name in controls.Keys)
{
float theValue;
string theValueStr = controls[name].ToString();
if (!String.IsNullOrWhiteSpace(theValueStr))
{
try
{
theValue = float.Parse(theValueStr);
float theValue = float.Parse(theValueStr);
if (controller == null)
{
Global.StickyXORAdapter.SetFloat(name.ToString(), theValue);
}
else
{
Global.StickyXORAdapter.SetFloat("P" + controller + " " + name.ToString(), theValue);
Global.StickyXORAdapter.SetFloat("P" + controller + " " + name, theValue);
}
}
catch { }

View File

@ -143,9 +143,9 @@
this.pathsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.soundToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autofireToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rewindOptionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.enableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.enableRewindToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.enableContextMenuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.backupSavestatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoSavestatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -1312,6 +1312,7 @@
this.pathsToolStripMenuItem,
this.soundToolStripMenuItem,
this.autofireToolStripMenuItem,
this.rewindOptionsToolStripMenuItem,
this.toolStripSeparator9,
this.enableToolStripMenuItem,
this.gUIToolStripMenuItem,
@ -1373,6 +1374,13 @@
this.autofireToolStripMenuItem.Text = "&Autofire...";
this.autofireToolStripMenuItem.Click += new System.EventHandler(this.autofireToolStripMenuItem_Click);
//
// rewindOptionsToolStripMenuItem
//
this.rewindOptionsToolStripMenuItem.Name = "rewindOptionsToolStripMenuItem";
this.rewindOptionsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.rewindOptionsToolStripMenuItem.Text = "Rewind...";
this.rewindOptionsToolStripMenuItem.Click += new System.EventHandler(this.rewindOptionsToolStripMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
@ -1381,7 +1389,6 @@
// enableToolStripMenuItem
//
this.enableToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.enableRewindToolStripMenuItem,
this.enableContextMenuToolStripMenuItem,
this.backupSavestatesToolStripMenuItem,
this.autoSavestatesToolStripMenuItem,
@ -1393,13 +1400,6 @@
this.enableToolStripMenuItem.Text = "&Enable";
this.enableToolStripMenuItem.DropDownOpened += new System.EventHandler(this.enableToolStripMenuItem_DropDownOpened);
//
// enableRewindToolStripMenuItem
//
this.enableRewindToolStripMenuItem.Name = "enableRewindToolStripMenuItem";
this.enableRewindToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
this.enableRewindToolStripMenuItem.Text = "&Enable Rewind";
this.enableRewindToolStripMenuItem.Click += new System.EventHandler(this.enableRewindToolStripMenuItem_Click);
//
// enableContextMenuToolStripMenuItem
//
this.enableContextMenuToolStripMenuItem.Name = "enableContextMenuToolStripMenuItem";
@ -3265,7 +3265,6 @@
private System.Windows.Forms.ToolStripMenuItem p0DifficultyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rightDifficultyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enableToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enableRewindToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enableContextMenuToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem backupSavestatesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem autoSavestatesToolStripMenuItem;
@ -3362,6 +3361,7 @@
private System.Windows.Forms.ToolStripMenuItem pathsToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem soundToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem autofireToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem rewindOptionsToolStripMenuItem;
}
}

View File

@ -548,24 +548,6 @@ namespace BizHawk.MultiClient
LoadNESPPU();
}
private void enableRewindToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RewindEnabled ^= true;
RewindMessage();
}
public void RewindMessage()
{
if (Global.Config.RewindEnabled)
{
Global.OSD.AddMessage("Rewind enabled");
}
else
{
Global.OSD.AddMessage("Rewind disabled");
}
}
private void hexEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
LoadHexEditor();
@ -1348,7 +1330,6 @@ namespace BizHawk.MultiClient
private void enableToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
enableRewindToolStripMenuItem.Checked = Global.Config.RewindEnabled;
enableContextMenuToolStripMenuItem.Checked = Global.Config.ShowContextMenu;
backupSavestatesToolStripMenuItem.Checked = Global.Config.BackupSavestates;
autoSavestatesToolStripMenuItem.Checked = Global.Config.AutoSavestates;
@ -2708,5 +2689,10 @@ namespace BizHawk.MultiClient
{
Global.Config.VBAStyleMovieLoadState ^= true;
}
private void rewindOptionsToolStripMenuItem_Click(object sender, EventArgs e)
{
new RewindConfig().ShowDialog();
}
}
}

View File

@ -39,6 +39,8 @@ namespace BizHawk.MultiClient
public bool UpdateFrame = false;
public bool NeedsReboot = false;
public bool RewindActive = true;
private Control renderTarget;
private RetainedViewportPanel retainedPanel;
private readonly SavestateManager StateSlots = new SavestateManager();
@ -2242,7 +2244,7 @@ namespace BizHawk.MultiClient
}
bool ReturnToRecording = Global.MovieSession.Movie.IsRecording;
if (Global.Config.RewindEnabled && (Global.ClientControls["Rewind"] || PressRewind))
if (RewindActive && (Global.ClientControls["Rewind"] || PressRewind))
{
Rewind(1);
suppressCaptureRewind = true;
@ -2311,7 +2313,7 @@ namespace BizHawk.MultiClient
Global.OSD.FPS = fps_string;
}
if (!suppressCaptureRewind && Global.Config.RewindEnabled) CaptureRewindState();
if (!suppressCaptureRewind && RewindActive) CaptureRewindState();
if (!runloop_frameadvance) genSound = true;
else if (!Global.Config.MuteFrameAdvance)

View File

@ -10,34 +10,14 @@ namespace BizHawk.MultiClient
private int RewindFrequency = 1;
void CaptureRewindState()
private void CaptureRewindState()
{
if (RewindImpossible)
return;
if (LastState == null)
{
// This is the first frame. Capture the state, and put it in LastState for future deltas to be compared against.
LastState = Global.Emulator.SaveStateBinary();
if (LastState.Length > 0x100000)
{
//RewindImpossible = true;
//LastState = null;
//Global.OSD.AddMessage("Rewind Disabled: State too large.");
//if (Global.Emulator.SystemId == "PCE")
// Global.OSD.AddMessage("See 'Arcade Card Rewind Hack' in Emulation->PC Engine options.");
RewindFrequency = 60;
Global.OSD.AddMessage("Rewind frequency set to 60");
}
else if (LastState.Length > 32768)
{
RewindFrequency = 2;
Global.OSD.AddMessage("Rewind frequency set to 2");
}
return;
DoRewindSettings();
}
// Otherwise, it's not the first frame, so build a delta.
@ -50,6 +30,80 @@ namespace BizHawk.MultiClient
}
}
public void DoRewindSettings()
{
// This is the first frame. Capture the state, and put it in LastState for future deltas to be compared against.
LastState = Global.Emulator.SaveStateBinary();
if (LastState.Length > 0x100000)
{
if (RewindActive != Global.Config.RewindEnabledLarge)
{
Global.OSD.AddMessage("Rewind " + (Global.Config.RewindEnabledLarge ? "Enabled" : "Disabled"));
}
if (Global.Config.RewindEnabledLarge)
{
RewindActive = true;
if (RewindFrequency != Global.Config.RewindFrequencyLarge)
{
Global.OSD.AddMessage("Rewind frequency set to " + Global.Config.RewindFrequencyLarge.ToString());
}
RewindFrequency = Global.Config.RewindFrequencyLarge;
}
else
{
RewindActive = false;
LastState = null;
}
}
else if (LastState.Length > 32768)
{
if (RewindActive != Global.Config.RewindEnabledMedium)
{
Global.OSD.AddMessage("Rewind " + (Global.Config.RewindEnabledMedium ? "Enabled" : "Disabled"));
}
if (Global.Config.RewindEnabledMedium)
{
RewindActive = true;
if (RewindFrequency != Global.Config.RewindFrequencyMedium)
{
Global.OSD.AddMessage("Rewind frequency set to " + Global.Config.RewindFrequencyMedium.ToString());
}
RewindFrequency = Global.Config.RewindFrequencyMedium;
}
else
{
RewindActive = false;
LastState = null;
}
}
else
{
if (RewindActive != Global.Config.RewindEnabledSmall)
{
Global.OSD.AddMessage("Rewind " + (Global.Config.RewindEnabledSmall ? "Enabled" : "Disabled"));
}
if (Global.Config.RewindEnabledSmall)
{
RewindActive = true;
if (RewindFrequency != Global.Config.RewindFrequencySmall)
{
Global.OSD.AddMessage("Rewind frequency set to " + Global.Config.RewindFrequencySmall.ToString());
}
RewindFrequency = Global.Config.RewindFrequencySmall;
}
else
{
RewindActive = false;
LastState = null;
}
}
}
// Builds a delta for states that are <= 64K in size.
void CaptureRewindState64K()
{

View File

@ -121,19 +121,7 @@ namespace BizHawk.MultiClient
private void button2_Click(object sender, EventArgs e)
{
Global.OSD.AddMessage("Hotkey config aborted");
this.Close();
}
protected override void OnShown(EventArgs e)
{
//Input.Instance.EnableIgnoreModifiers = true;
base.OnShown(e);
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
//Input.Instance.EnableIgnoreModifiers = false;
Close();
}
private void IDB_SAVE_Click(object sender, EventArgs e)
@ -245,8 +233,8 @@ namespace BizHawk.MultiClient
Global.Config.ClearFrameBinding = IDW_ClearFrame.Text;
Global.OSD.AddMessage("Hotkey settings saved");
this.DialogResult = DialogResult.OK;
this.Close();
DialogResult = DialogResult.OK;
Close();
}
private void hotkeyTabs_SelectedIndexChanged(object sender, EventArgs e)
@ -255,8 +243,6 @@ namespace BizHawk.MultiClient
string name = hotkeyTabs.TabPages[hotkeyTabs.SelectedIndex].Text;
switch (name)
{
default:
break;
case "General":
IDW_FRAMEADVANCE.Focus();
break;

View File

@ -0,0 +1,340 @@
namespace BizHawk.MultiClient
{
partial class RewindConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.OK = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.SmallLabel1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label10 = new System.Windows.Forms.Label();
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.LargeLabel1 = 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.MediumLabel1 = 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.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LargeSavestateNumeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MediumSavestateNumeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SmallSavestateNumeric)).BeginInit();
this.SuspendLayout();
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(215, 137);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0;
this.OK.Text = "&Ok";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.OK_Click);
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(296, 137);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 1;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// SmallLabel1
//
this.SmallLabel1.AutoSize = true;
this.SmallLabel1.Location = new System.Drawing.Point(40, 40);
this.SmallLabel1.Name = "SmallLabel1";
this.SmallLabel1.Size = new System.Drawing.Size(164, 13);
this.SmallLabel1.TabIndex = 2;
this.SmallLabel1.Text = "Small savestates (less than 32kb)";
this.SmallLabel1.Click += new System.EventHandler(this.SmallLabel1_Click);
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label10);
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.LargeLabel1);
this.groupBox1.Controls.Add(this.MediumLabel2);
this.groupBox1.Controls.Add(this.MediumLabel3);
this.groupBox1.Controls.Add(this.MediumSavestateNumeric);
this.groupBox1.Controls.Add(this.MediumLabel1);
this.groupBox1.Controls.Add(this.SmallLabel2);
this.groupBox1.Controls.Add(this.SmallLabel3);
this.groupBox1.Controls.Add(this.SmallSavestateNumeric);
this.groupBox1.Controls.Add(this.SmallLabel1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(359, 118);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Rewind frequency";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(6, 22);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(40, 13);
this.label10.TabIndex = 17;
this.label10.Text = "Enable";
//
// LargeStateEnabledBox
//
this.LargeStateEnabledBox.AutoSize = true;
this.LargeStateEnabledBox.Location = new System.Drawing.Point(9, 87);
this.LargeStateEnabledBox.Name = "LargeStateEnabledBox";
this.LargeStateEnabledBox.Size = new System.Drawing.Size(15, 14);
this.LargeStateEnabledBox.TabIndex = 16;
this.LargeStateEnabledBox.UseVisualStyleBackColor = true;
this.LargeStateEnabledBox.CheckStateChanged += new System.EventHandler(this.LargeStateEnabledBox_CheckStateChanged);
//
// MediumStateEnabledBox
//
this.MediumStateEnabledBox.AutoSize = true;
this.MediumStateEnabledBox.Location = new System.Drawing.Point(9, 63);
this.MediumStateEnabledBox.Name = "MediumStateEnabledBox";
this.MediumStateEnabledBox.Size = new System.Drawing.Size(15, 14);
this.MediumStateEnabledBox.TabIndex = 15;
this.MediumStateEnabledBox.UseVisualStyleBackColor = true;
this.MediumStateEnabledBox.CheckStateChanged += new System.EventHandler(this.MediumStateEnabledBox_CheckStateChanged);
//
// SmallStateEnabledBox
//
this.SmallStateEnabledBox.AutoSize = true;
this.SmallStateEnabledBox.Location = new System.Drawing.Point(9, 39);
this.SmallStateEnabledBox.Name = "SmallStateEnabledBox";
this.SmallStateEnabledBox.Size = new System.Drawing.Size(15, 14);
this.SmallStateEnabledBox.TabIndex = 14;
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 = 12;
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 = 11;
this.LargeSavestateNumeric.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// LargeLabel1
//
this.LargeLabel1.AutoSize = true;
this.LargeLabel1.Location = new System.Drawing.Point(40, 88);
this.LargeLabel1.Name = "LargeLabel1";
this.LargeLabel1.Size = new System.Drawing.Size(177, 13);
this.LargeLabel1.TabIndex = 10;
this.LargeLabel1.Text = "Large savestates (more than 100kb)";
this.LargeLabel1.Click += new System.EventHandler(this.LargeLabel1_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 = 9;
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 = 8;
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 = 7;
this.MediumSavestateNumeric.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// MediumLabel1
//
this.MediumLabel1.AutoSize = true;
this.MediumLabel1.Location = new System.Drawing.Point(40, 64);
this.MediumLabel1.Name = "MediumLabel1";
this.MediumLabel1.Size = new System.Drawing.Size(158, 13);
this.MediumLabel1.TabIndex = 6;
this.MediumLabel1.Text = "Medium savestates (32 - 100kb)";
this.MediumLabel1.Click += new System.EventHandler(this.MediumLabel1_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 = 5;
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 = 4;
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 = 3;
this.SmallSavestateNumeric.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// RewindConfig
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(383, 172);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OK);
this.Name = "RewindConfig";
this.ShowIcon = false;
this.Text = "Rewind Settings";
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.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button OK;
private System.Windows.Forms.Button Cancel;
private System.Windows.Forms.Label SmallLabel1;
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 LargeLabel1;
private System.Windows.Forms.Label MediumLabel2;
private System.Windows.Forms.Label MediumLabel3;
private System.Windows.Forms.NumericUpDown MediumSavestateNumeric;
private System.Windows.Forms.Label MediumLabel1;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.CheckBox LargeStateEnabledBox;
private System.Windows.Forms.CheckBox MediumStateEnabledBox;
private System.Windows.Forms.CheckBox SmallStateEnabledBox;
}
}

View File

@ -0,0 +1,102 @@
using System;
using System.Windows.Forms;
namespace BizHawk.MultiClient
{
public partial class RewindConfig : Form
{
public RewindConfig()
{
InitializeComponent();
}
private void RewindConfig_Load(object sender, EventArgs e)
{
SmallSavestateNumeric.Value = Global.Config.RewindFrequencySmall;
MediumSavestateNumeric.Value = Global.Config.RewindFrequencyMedium;
LargeSavestateNumeric.Value = Global.Config.RewindFrequencyLarge;
SmallStateEnabledBox.Checked = Global.Config.RewindEnabledSmall;
MediumStateEnabledBox.Checked = Global.Config.RewindEnabledMedium;
LargeStateEnabledBox.Checked = Global.Config.RewindEnabledLarge;
SetSmallEnabled();
SetMediumEnabled();
SetLargeEnabled();
}
private void Cancel_Click(object sender, EventArgs e)
{
Global.OSD.AddMessage("Rewind config aborted");
Close();
}
private void OK_Click(object sender, EventArgs e)
{
Global.OSD.AddMessage("Rewind settings saved");
Global.Config.RewindFrequencySmall = (int)SmallSavestateNumeric.Value;
Global.Config.RewindFrequencyMedium = (int)MediumSavestateNumeric.Value;
Global.Config.RewindFrequencyLarge = (int)LargeSavestateNumeric.Value;
Global.Config.RewindEnabledSmall = SmallStateEnabledBox.Checked;
Global.Config.RewindEnabledMedium = MediumStateEnabledBox.Checked;
Global.Config.RewindEnabledLarge = LargeStateEnabledBox.Checked;
Global.MainForm.DoRewindSettings();
Close();
}
private void SetSmallEnabled()
{
SmallLabel1.Enabled = SmallLabel2.Enabled
= SmallSavestateNumeric.Enabled = SmallLabel3.Enabled
= SmallStateEnabledBox.Checked;
}
private void SetMediumEnabled()
{
MediumLabel1.Enabled = MediumLabel2.Enabled
= MediumSavestateNumeric.Enabled = MediumLabel3.Enabled
= MediumStateEnabledBox.Checked;
}
private void SetLargeEnabled()
{
LargeLabel1.Enabled = LargeLabel2.Enabled
= LargeSavestateNumeric.Enabled = LargeLabel3.Enabled
= LargeStateEnabledBox.Checked;
}
private void SmallStateEnabledBox_CheckStateChanged(object sender, EventArgs e)
{
SetSmallEnabled();
}
private void MediumStateEnabledBox_CheckStateChanged(object sender, EventArgs e)
{
SetMediumEnabled();
}
private void LargeStateEnabledBox_CheckStateChanged(object sender, EventArgs e)
{
SetLargeEnabled();
}
private void LargeLabel1_Click(object sender, EventArgs e)
{
LargeStateEnabledBox.Checked ^= true;
}
private void MediumLabel1_Click(object sender, EventArgs e)
{
MediumStateEnabledBox.Checked ^= true;
}
private void SmallLabel1_Click(object sender, EventArgs e)
{
SmallStateEnabledBox.Checked ^= true;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>