Add N64 info to the about box, add delta compression toggle in rewind settings, make defaults for medium and large states 256kb and 1mb respectively, make those dynamic (but not currently settable in the GUI)

This commit is contained in:
adelikat 2013-07-28 19:09:52 +00:00
parent 9910eff07d
commit 4a89c7fbd5
6 changed files with 170 additions and 40 deletions

View File

@ -41,6 +41,9 @@
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.linkLabel4 = new System.Windows.Forms.LinkLabel();
this.label28 = new System.Windows.Forms.Label();
this.label30 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.linkLabel3 = new System.Windows.Forms.LinkLabel();
@ -63,9 +66,9 @@
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
this.label28 = new System.Windows.Forms.Label();
this.label30 = new System.Windows.Forms.Label();
this.linkLabel4 = new System.Windows.Forms.LinkLabel();
this.linkLabel5 = new System.Windows.Forms.LinkLabel();
this.label29 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
@ -74,7 +77,7 @@
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.OK.Location = new System.Drawing.Point(361, 455);
this.OK.Location = new System.Drawing.Point(361, 478);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0;
@ -96,7 +99,7 @@
//
this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(173, 459);
this.linkLabel1.Location = new System.Drawing.Point(173, 482);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(180, 13);
this.linkLabel1.TabIndex = 2;
@ -183,6 +186,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.linkLabel5);
this.panel1.Controls.Add(this.label29);
this.panel1.Controls.Add(this.label31);
this.panel1.Controls.Add(this.linkLabel4);
this.panel1.Controls.Add(this.label28);
this.panel1.Controls.Add(this.label30);
@ -209,9 +215,38 @@
this.panel1.Controls.Add(this.label8);
this.panel1.Location = new System.Drawing.Point(12, 182);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(423, 267);
this.panel1.Size = new System.Drawing.Size(423, 290);
this.panel1.TabIndex = 11;
//
// linkLabel4
//
this.linkLabel4.AutoSize = true;
this.linkLabel4.Location = new System.Drawing.Point(212, 225);
this.linkLabel4.Name = "linkLabel4";
this.linkLabel4.Size = new System.Drawing.Size(55, 13);
this.linkLabel4.TabIndex = 26;
this.linkLabel4.TabStop = true;
this.linkLabel4.Text = "EMU7800";
this.linkLabel4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
//
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(212, 238);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(104, 13);
this.label28.TabIndex = 25;
this.label28.Text = "author: Mike Murphy";
//
// label30
//
this.label30.AutoSize = true;
this.label30.Location = new System.Drawing.Point(204, 207);
this.label30.Name = "label30";
this.label30.Size = new System.Drawing.Size(80, 13);
this.label30.TabIndex = 23;
this.label30.Text = "Atari7800Hawk";
//
// label12
//
this.label12.AutoSize = true;
@ -414,34 +449,34 @@
this.label27.TabIndex = 12;
this.label27.Text = "SaxxonPike";
//
// label28
// linkLabel5
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(212, 238);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(104, 13);
this.label28.TabIndex = 25;
this.label28.Text = "author: Mike Murphy";
this.linkLabel5.AutoSize = true;
this.linkLabel5.Location = new System.Drawing.Point(21, 256);
this.linkLabel5.Name = "linkLabel5";
this.linkLabel5.Size = new System.Drawing.Size(72, 13);
this.linkLabel5.TabIndex = 29;
this.linkLabel5.TabStop = true;
this.linkLabel5.Text = "Mupen64Plus";
this.linkLabel5.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel5_LinkClicked);
//
// label30
// label29
//
this.label30.AutoSize = true;
this.label30.Location = new System.Drawing.Point(204, 207);
this.label30.Name = "label30";
this.label30.Size = new System.Drawing.Size(80, 13);
this.label30.TabIndex = 23;
this.label30.Text = "Atari7800Hawk";
this.label29.AutoSize = true;
this.label29.Location = new System.Drawing.Point(21, 269);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(101, 13);
this.label29.TabIndex = 28;
this.label29.Text = "Ported by: micro500";
//
// linkLabel4
// label31
//
this.linkLabel4.AutoSize = true;
this.linkLabel4.Location = new System.Drawing.Point(212, 225);
this.linkLabel4.Name = "linkLabel4";
this.linkLabel4.Size = new System.Drawing.Size(55, 13);
this.linkLabel4.TabIndex = 26;
this.linkLabel4.TabStop = true;
this.linkLabel4.Text = "EMU7800";
this.linkLabel4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
this.label31.AutoSize = true;
this.label31.Location = new System.Drawing.Point(13, 238);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(55, 13);
this.label31.TabIndex = 27;
this.label31.Text = "N64Hawk";
//
// BizBox
//
@ -449,7 +484,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.OK;
this.ClientSize = new System.Drawing.Size(448, 490);
this.ClientSize = new System.Drawing.Size(448, 513);
this.Controls.Add(this.label27);
this.Controls.Add(this.panel1);
this.Controls.Add(this.label7);
@ -516,5 +551,8 @@
private System.Windows.Forms.Label label28;
private System.Windows.Forms.Label label30;
private System.Windows.Forms.LinkLabel linkLabel4;
private System.Windows.Forms.LinkLabel linkLabel5;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.Label label31;
}
}

View File

@ -44,5 +44,11 @@ namespace BizHawk.MultiClient
linkLabel4.LinkVisited = true;
System.Diagnostics.Process.Start("http://emu7800.sourceforge.net/");
}
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
linkLabel5.LinkVisited = true;
System.Diagnostics.Process.Start("https://code.google.com/p/mupen64plus/");
}
}
}

View File

@ -226,13 +226,15 @@ namespace BizHawk.MultiClient
public bool VSyncThrottle = false;
//Rewind settings
public bool Rewind_UseDelta = true;
public bool RewindEnabledSmall = true;
public bool RewindEnabledMedium = true;
public bool RewindEnabledLarge = true;
public int RewindFrequencySmall = 1;
public int RewindFrequencyMedium = 2;
public int RewindFrequencyLarge = 60;
public int Rewind_MediumStateSize = 262144; //256kb
public int Rewind_LargeStateSize = 1048576; //1mb
/// <summary>use vsync. if VSyncThrottle = false, this will try to use vsync without throttling to it</summary>
public bool VSync = false;

View File

@ -286,15 +286,21 @@ namespace BizHawk.MultiClient
// 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)
SetRewindParams(Global.Config.RewindEnabledLarge,Global.Config.RewindFrequencyLarge);
else if (LastState.Length > 32768)
SetRewindParams(Global.Config.RewindEnabledMedium,Global.Config.RewindFrequencyMedium);
if (LastState.Length >= Global.Config.Rewind_LargeStateSize)
{
SetRewindParams(Global.Config.RewindEnabledLarge, Global.Config.RewindFrequencyLarge);
}
else if (LastState.Length >= Global.Config.RewindFrequencyMedium)
{
SetRewindParams(Global.Config.RewindEnabledMedium, Global.Config.RewindFrequencyMedium);
}
else
{
SetRewindParams(Global.Config.RewindEnabledSmall, Global.Config.RewindFrequencySmall);
}
//adelikat: placeholder for plucking from config
RewindDeltaEnable = true;
RewindDeltaEnable = Global.Config.Rewind_UseDelta;
}
void CaptureRewindStateNonDelta()

View File

@ -47,6 +47,9 @@
this.SmallLabel2 = new System.Windows.Forms.Label();
this.SmallLabel3 = new System.Windows.Forms.Label();
this.SmallSavestateNumeric = new System.Windows.Forms.NumericUpDown();
this.UseDeltaCompression = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.StateSizeLabel = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LargeSavestateNumeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MediumSavestateNumeric)).BeginInit();
@ -56,7 +59,7 @@
// 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.Location = new System.Drawing.Point(215, 186);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0;
@ -68,7 +71,7 @@
//
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.Location = new System.Drawing.Point(296, 186);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 1;
@ -106,7 +109,7 @@
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.Location = new System.Drawing.Point(12, 38);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(359, 118);
this.groupBox1.TabIndex = 3;
@ -291,6 +294,34 @@
0,
0,
0});
//
// UseDeltaCompression
//
this.UseDeltaCompression.AutoSize = true;
this.UseDeltaCompression.Location = new System.Drawing.Point(21, 162);
this.UseDeltaCompression.Name = "UseDeltaCompression";
this.UseDeltaCompression.Size = new System.Drawing.Size(133, 17);
this.UseDeltaCompression.TabIndex = 4;
this.UseDeltaCompression.Text = "Use delta compression";
this.UseDeltaCompression.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(118, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Current Savestate Size:";
//
// StateSizeLabel
//
this.StateSizeLabel.AutoSize = true;
this.StateSizeLabel.Location = new System.Drawing.Point(142, 9);
this.StateSizeLabel.Name = "StateSizeLabel";
this.StateSizeLabel.Size = new System.Drawing.Size(28, 13);
this.StateSizeLabel.TabIndex = 6;
this.StateSizeLabel.Text = "0 kb";
//
// RewindConfig
//
@ -298,7 +329,10 @@
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.ClientSize = new System.Drawing.Size(383, 221);
this.Controls.Add(this.StateSizeLabel);
this.Controls.Add(this.label1);
this.Controls.Add(this.UseDeltaCompression);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OK);
@ -312,6 +346,7 @@
((System.ComponentModel.ISupportInitialize)(this.MediumSavestateNumeric)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SmallSavestateNumeric)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -336,5 +371,8 @@
private System.Windows.Forms.CheckBox LargeStateEnabledBox;
private System.Windows.Forms.CheckBox MediumStateEnabledBox;
private System.Windows.Forms.CheckBox SmallStateEnabledBox;
private System.Windows.Forms.CheckBox UseDeltaCompression;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label StateSizeLabel;
}
}

View File

@ -1,10 +1,12 @@
using System;
using System.Windows.Forms;
using System.Drawing;
namespace BizHawk.MultiClient
{
public partial class RewindConfig : Form
{
private long StateSize;
public RewindConfig()
{
InitializeComponent();
@ -12,6 +14,8 @@ namespace BizHawk.MultiClient
private void RewindConfig_Load(object sender, EventArgs e)
{
UseDeltaCompression.Checked = Global.Config.Rewind_UseDelta;
SmallSavestateNumeric.Value = Global.Config.RewindFrequencySmall;
MediumSavestateNumeric.Value = Global.Config.RewindFrequencyMedium;
LargeSavestateNumeric.Value = Global.Config.RewindFrequencyLarge;
@ -23,6 +27,40 @@ namespace BizHawk.MultiClient
SetSmallEnabled();
SetMediumEnabled();
SetLargeEnabled();
SetStateSize();
}
private void SetStateSize()
{
StateSize = Global.Emulator.SaveStateBinary().Length;
double num = StateSize / 1024.0;
StateSizeLabel.Text = String.Format("{0:0.00}", num) + " kb";
SmallLabel1.Text = "Small savestates (less than " + (Global.Config.Rewind_MediumStateSize / 1024).ToString() + "kb)";
MediumLabel1.Text = "Medium savestates (" + (Global.Config.Rewind_MediumStateSize / 1024).ToString()
+ " - " + (Global.Config.Rewind_LargeStateSize / 1024) + "kb)";
LargeLabel1.Text = "Large savestates (" + (Global.Config.Rewind_LargeStateSize / 1024) + "kb or more)";
if (StateSize >= Global.Config.Rewind_LargeStateSize)
{
SmallLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
MediumLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
LargeLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Italic);
}
else if (StateSize >= Global.Config.Rewind_MediumStateSize)
{
SmallLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
MediumLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Italic);
LargeLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
}
else
{
SmallLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Italic);
MediumLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
LargeLabel1.Font = new Font(SmallLabel1.Font, FontStyle.Regular);
}
}
private void Cancel_Click(object sender, EventArgs e)
@ -45,6 +83,8 @@ namespace BizHawk.MultiClient
Global.MainForm.DoRewindSettings();
Global.Config.Rewind_UseDelta = UseDeltaCompression.Checked;
Close();
}