From 91dc78010340f727c5d898214b147faef1474f11 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Tue, 17 Mar 2015 01:02:38 +0000 Subject: [PATCH] Fixes/changed to state history saving. State History Integrity Check now stops at the last state. --- .../movie/tasproj/TasLagLog.cs | 15 ++- .../movie/tasproj/TasMovie.IO.cs | 8 +- .../movie/tasproj/TasStateManager.cs | 54 +++++++---- .../tools/TAStudio/TAStudio.Designer.cs | 92 +++++++++---------- .../tools/TAStudio/TAStudio.ListView.cs | 1 - .../tools/TAStudio/TAStudio.MenuItems.cs | 9 +- 6 files changed, 102 insertions(+), 77 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs index e179cd4a31..426f9a581c 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs @@ -46,9 +46,18 @@ namespace BizHawk.Client.Common return; // Nothing to do } - if (frame == LagLog.Count) + if (frame >= LagLog.Count) { LagLog.Add(value.Value); + if (frame >= LagLog.Count) + { + System.Diagnostics.Debugger.Break(); + System.Diagnostics.Debug.Print("Lag Log error. f" + frame); + do + { + LagLog.Add(value.Value); + } while (frame >= LagLog.Count); + } } else LagLog[frame] = value.Value; @@ -67,8 +76,8 @@ namespace BizHawk.Client.Common public void RemoveFrom(int frame) { - if (LagLog.Count >= frame && frame >= 0) - LagLog.RemoveRange(frame, LagLog.Count - frame); + if (LagLog.Count > frame && frame >= 0) + LagLog.RemoveRange(frame + 1, LagLog.Count - frame - 1); } public void RemoveHistoryAt(int frame) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs index 28868d2382..b6a286d7e5 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs @@ -209,11 +209,9 @@ namespace BizHawk.Client.Common StateManager.Load(br); }); } - else - { // Movie should always have a state at frame 0. - if (!this.StartsFromSavestate) - StateManager.Capture(); - } + // Movie should always have a state at frame 0. + if (!this.StartsFromSavestate) + StateManager.Capture(); bl.GetLump(BinaryStateLump.Markers, false, delegate(TextReader tr) { diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 5719e08222..f8747c1a95 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -152,7 +152,7 @@ namespace BizHawk.Client.Common } else { - shouldCapture = frame - States.Keys.Last(k => k < frame) >= StateFrequency; + shouldCapture = frame - States.Keys.LastOrDefault(k => k < frame) >= StateFrequency; } if (shouldCapture) @@ -370,27 +370,12 @@ namespace BizHawk.Client.Common public void Save(BinaryWriter bw) { - List noSave = new List(); - if (Used + DiskUsed > (ulong)Settings.DiskSaveCapacitymb * 1024 * 1024) - { - ulong saveUsed = Used + DiskUsed; - do - { - // TODO: Use a different method to remove states. - // e.g. Saving should place higher priority on keeping markers - int index = StateToRemove(); - noSave.Add(index); - if (States.ElementAt(index).Value == null) - saveUsed -= _expectedStateSize; - else - saveUsed -= (ulong)States.ElementAt(index).Value.Length; - } while (saveUsed > (ulong)Settings.DiskSaveCapacitymb * 1024 * 1024); - } + List noSave = ExcludeStates(); bw.Write(States.Count - noSave.Count); for (int i = 0; i < States.Count; i++) { - if (noSave.Contains(States.ElementAt(i).Key)) + if (noSave.Contains(i)) continue; StateAccessed(States.ElementAt(i).Key); @@ -400,6 +385,39 @@ namespace BizHawk.Client.Common bw.Write(kvp.Value); } } + private List ExcludeStates() + { + List ret = new List(); + + ulong saveUsed = Used + DiskUsed; + int index = -1; + while (saveUsed > (ulong)Settings.DiskSaveCapacitymb * 1024 * 1024) + { + do + { + index++; + } while (_movie.Markers.IsMarker(States.ElementAt(index).Key + 1)); + ret.Add(index); + if (States.ElementAt(index).Value == null) + saveUsed -= _expectedStateSize; + else + saveUsed -= (ulong)States.ElementAt(index).Value.Length; + } + + // If there are enough markers to still be over the limit, remove marker frames + index = -1; + while (saveUsed > (ulong)Settings.DiskSaveCapacitymb * 1024 * 1024) + { + index++; + ret.Add(index); + if (States.ElementAt(index).Value == null) + saveUsed -= _expectedStateSize; + else + saveUsed -= (ulong)States.ElementAt(index).Value.Length; + } + + return ret; + } public void Load(BinaryReader br) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index a31e24e84c..631e7e574e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -75,7 +75,7 @@ namespace BizHawk.Client.EmuHawk this.TruncateMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ClearGreenzoneMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.GreenzoneICheckSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.GreenZoneIntegrityCheckMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.StateHistoryIntegrityCheckMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ConfigSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.SetMaxUndoLevelsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); @@ -140,6 +140,7 @@ namespace BizHawk.Client.EmuHawk this.TasPlaybackBox = new BizHawk.Client.EmuHawk.PlaybackBox(); this.MarkerControl = new BizHawk.Client.EmuHawk.MarkerControl(); this.MarkerContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.ScrollToMarkerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.EditMarkerContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AddMarkerContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RemoveMarkerContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -168,7 +169,6 @@ namespace BizHawk.Client.EmuHawk this.StartFromNowSeparator = new System.Windows.Forms.ToolStripSeparator(); this.StartNewProjectFromNowMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.ScrollToMarkerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TASMenu.SuspendLayout(); this.TasStatusStrip.SuspendLayout(); this.MarkerContextMenu.SuspendLayout(); @@ -349,7 +349,7 @@ namespace BizHawk.Client.EmuHawk this.TruncateMenuItem, this.ClearGreenzoneMenuItem, this.GreenzoneICheckSeparator, - this.GreenZoneIntegrityCheckMenuItem}); + this.StateHistoryIntegrityCheckMenuItem}); this.EditSubMenu.Name = "EditSubMenu"; this.EditSubMenu.Size = new System.Drawing.Size(39, 20); this.EditSubMenu.Text = "&Edit"; @@ -359,7 +359,7 @@ namespace BizHawk.Client.EmuHawk // this.UndoMenuItem.Name = "UndoMenuItem"; this.UndoMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); - this.UndoMenuItem.Size = new System.Drawing.Size(282, 22); + this.UndoMenuItem.Size = new System.Drawing.Size(293, 22); this.UndoMenuItem.Text = "&Undo"; this.UndoMenuItem.Click += new System.EventHandler(this.UndoMenuItem_Click); // @@ -368,14 +368,14 @@ namespace BizHawk.Client.EmuHawk this.RedoMenuItem.Enabled = false; this.RedoMenuItem.Name = "RedoMenuItem"; this.RedoMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); - this.RedoMenuItem.Size = new System.Drawing.Size(282, 22); + this.RedoMenuItem.Size = new System.Drawing.Size(293, 22); this.RedoMenuItem.Text = "&Redo"; this.RedoMenuItem.Click += new System.EventHandler(this.RedoMenuItem_Click); // // showUndoHistoryToolStripMenuItem // this.showUndoHistoryToolStripMenuItem.Name = "showUndoHistoryToolStripMenuItem"; - this.showUndoHistoryToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.showUndoHistoryToolStripMenuItem.Size = new System.Drawing.Size(293, 22); this.showUndoHistoryToolStripMenuItem.Text = "Show Undo History"; this.showUndoHistoryToolStripMenuItem.Click += new System.EventHandler(this.showUndoHistoryToolStripMenuItem_Click); // @@ -384,7 +384,7 @@ namespace BizHawk.Client.EmuHawk this.SelectionUndoMenuItem.Enabled = false; this.SelectionUndoMenuItem.Name = "SelectionUndoMenuItem"; this.SelectionUndoMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q))); - this.SelectionUndoMenuItem.Size = new System.Drawing.Size(282, 22); + this.SelectionUndoMenuItem.Size = new System.Drawing.Size(293, 22); this.SelectionUndoMenuItem.Text = "Selection Undo"; // // SelectionRedoMenuItem @@ -392,18 +392,18 @@ namespace BizHawk.Client.EmuHawk this.SelectionRedoMenuItem.Enabled = false; this.SelectionRedoMenuItem.Name = "SelectionRedoMenuItem"; this.SelectionRedoMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); - this.SelectionRedoMenuItem.Size = new System.Drawing.Size(282, 22); + this.SelectionRedoMenuItem.Size = new System.Drawing.Size(293, 22); this.SelectionRedoMenuItem.Text = "Selection Redo"; // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(279, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(290, 6); // // DeselectMenuItem // this.DeselectMenuItem.Name = "DeselectMenuItem"; - this.DeselectMenuItem.Size = new System.Drawing.Size(282, 22); + this.DeselectMenuItem.Size = new System.Drawing.Size(293, 22); this.DeselectMenuItem.Text = "Deselect"; this.DeselectMenuItem.Click += new System.EventHandler(this.DeselectMenuItem_Click); // @@ -412,7 +412,7 @@ namespace BizHawk.Client.EmuHawk this.SelectAllMenuItem.Name = "SelectAllMenuItem"; this.SelectAllMenuItem.ShortcutKeyDisplayString = ""; this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); - this.SelectAllMenuItem.Size = new System.Drawing.Size(282, 22); + this.SelectAllMenuItem.Size = new System.Drawing.Size(293, 22); this.SelectAllMenuItem.Text = "Select &All"; this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click); // @@ -421,7 +421,7 @@ namespace BizHawk.Client.EmuHawk this.SelectBetweenMarkersMenuItem.Name = "SelectBetweenMarkersMenuItem"; this.SelectBetweenMarkersMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.A))); - this.SelectBetweenMarkersMenuItem.Size = new System.Drawing.Size(282, 22); + this.SelectBetweenMarkersMenuItem.Size = new System.Drawing.Size(293, 22); this.SelectBetweenMarkersMenuItem.Text = "Select between Markers"; this.SelectBetweenMarkersMenuItem.Click += new System.EventHandler(this.SelectBetweenMarkersMenuItem_Click); // @@ -429,20 +429,20 @@ namespace BizHawk.Client.EmuHawk // this.ReselectClipboardMenuItem.Name = "ReselectClipboardMenuItem"; this.ReselectClipboardMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B))); - this.ReselectClipboardMenuItem.Size = new System.Drawing.Size(282, 22); + this.ReselectClipboardMenuItem.Size = new System.Drawing.Size(293, 22); this.ReselectClipboardMenuItem.Text = "Reselect Clipboard"; this.ReselectClipboardMenuItem.Click += new System.EventHandler(this.ReselectClipboardMenuItem_Click); // // toolStripSeparator7 // this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(279, 6); + this.toolStripSeparator7.Size = new System.Drawing.Size(290, 6); // // CopyMenuItem // this.CopyMenuItem.Name = "CopyMenuItem"; this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); - this.CopyMenuItem.Size = new System.Drawing.Size(282, 22); + this.CopyMenuItem.Size = new System.Drawing.Size(293, 22); this.CopyMenuItem.Text = "Copy"; this.CopyMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click); // @@ -450,7 +450,7 @@ namespace BizHawk.Client.EmuHawk // this.PasteMenuItem.Name = "PasteMenuItem"; this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); - this.PasteMenuItem.Size = new System.Drawing.Size(282, 22); + this.PasteMenuItem.Size = new System.Drawing.Size(293, 22); this.PasteMenuItem.Text = "&Paste"; this.PasteMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click); // @@ -459,7 +459,7 @@ namespace BizHawk.Client.EmuHawk this.PasteInsertMenuItem.Name = "PasteInsertMenuItem"; this.PasteInsertMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.V))); - this.PasteInsertMenuItem.Size = new System.Drawing.Size(282, 22); + this.PasteInsertMenuItem.Size = new System.Drawing.Size(293, 22); this.PasteInsertMenuItem.Text = "&Paste Insert"; this.PasteInsertMenuItem.Click += new System.EventHandler(this.PasteInsertMenuItem_Click); // @@ -467,21 +467,21 @@ namespace BizHawk.Client.EmuHawk // this.CutMenuItem.Name = "CutMenuItem"; this.CutMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); - this.CutMenuItem.Size = new System.Drawing.Size(282, 22); + this.CutMenuItem.Size = new System.Drawing.Size(293, 22); this.CutMenuItem.Text = "&Cut"; this.CutMenuItem.Click += new System.EventHandler(this.CutMenuItem_Click); // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(279, 6); + this.toolStripSeparator8.Size = new System.Drawing.Size(290, 6); // // ClearMenuItem // this.ClearMenuItem.Name = "ClearMenuItem"; this.ClearMenuItem.ShortcutKeyDisplayString = ""; this.ClearMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete))); - this.ClearMenuItem.Size = new System.Drawing.Size(282, 22); + this.ClearMenuItem.Size = new System.Drawing.Size(293, 22); this.ClearMenuItem.Text = "Clear"; this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click); // @@ -489,7 +489,7 @@ namespace BizHawk.Client.EmuHawk // this.DeleteFramesMenuItem.Name = "DeleteFramesMenuItem"; this.DeleteFramesMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; - this.DeleteFramesMenuItem.Size = new System.Drawing.Size(282, 22); + this.DeleteFramesMenuItem.Size = new System.Drawing.Size(293, 22); this.DeleteFramesMenuItem.Text = "&Delete"; this.DeleteFramesMenuItem.Click += new System.EventHandler(this.DeleteFramesMenuItem_Click); // @@ -497,7 +497,7 @@ namespace BizHawk.Client.EmuHawk // this.CloneMenuItem.Name = "CloneMenuItem"; this.CloneMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert))); - this.CloneMenuItem.Size = new System.Drawing.Size(282, 22); + this.CloneMenuItem.Size = new System.Drawing.Size(293, 22); this.CloneMenuItem.Text = "&Clone"; this.CloneMenuItem.Click += new System.EventHandler(this.CloneMenuItem_Click); // @@ -506,7 +506,7 @@ namespace BizHawk.Client.EmuHawk this.InsertFrameMenuItem.Name = "InsertFrameMenuItem"; this.InsertFrameMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.Insert))); - this.InsertFrameMenuItem.Size = new System.Drawing.Size(282, 22); + this.InsertFrameMenuItem.Size = new System.Drawing.Size(293, 22); this.InsertFrameMenuItem.Text = "&Insert"; this.InsertFrameMenuItem.Click += new System.EventHandler(this.InsertFrameMenuItem_Click); // @@ -515,42 +515,42 @@ namespace BizHawk.Client.EmuHawk this.InsertNumFramesMenuItem.Name = "InsertNumFramesMenuItem"; this.InsertNumFramesMenuItem.ShortcutKeyDisplayString = ""; this.InsertNumFramesMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Insert; - this.InsertNumFramesMenuItem.Size = new System.Drawing.Size(282, 22); + this.InsertNumFramesMenuItem.Size = new System.Drawing.Size(293, 22); this.InsertNumFramesMenuItem.Text = "Insert # of Frames"; this.InsertNumFramesMenuItem.Click += new System.EventHandler(this.InsertNumFramesMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(279, 6); + this.toolStripSeparator6.Size = new System.Drawing.Size(290, 6); // // TruncateMenuItem // this.TruncateMenuItem.Name = "TruncateMenuItem"; - this.TruncateMenuItem.Size = new System.Drawing.Size(282, 22); + this.TruncateMenuItem.Size = new System.Drawing.Size(293, 22); this.TruncateMenuItem.Text = "&Truncate Movie"; this.TruncateMenuItem.Click += new System.EventHandler(this.TruncateMenuItem_Click); // // ClearGreenzoneMenuItem // this.ClearGreenzoneMenuItem.Name = "ClearGreenzoneMenuItem"; - this.ClearGreenzoneMenuItem.Size = new System.Drawing.Size(282, 22); + this.ClearGreenzoneMenuItem.Size = new System.Drawing.Size(293, 22); this.ClearGreenzoneMenuItem.Text = "&Clear Savestate History"; this.ClearGreenzoneMenuItem.Click += new System.EventHandler(this.ClearGreenzoneMenuItem_Click); // // GreenzoneICheckSeparator // this.GreenzoneICheckSeparator.Name = "GreenzoneICheckSeparator"; - this.GreenzoneICheckSeparator.Size = new System.Drawing.Size(279, 6); + this.GreenzoneICheckSeparator.Size = new System.Drawing.Size(290, 6); // - // GreenZoneIntegrityCheckMenuItem + // StateHistoryIntegrityCheckMenuItem // - this.GreenZoneIntegrityCheckMenuItem.Name = "GreenZoneIntegrityCheckMenuItem"; - this.GreenZoneIntegrityCheckMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.StateHistoryIntegrityCheckMenuItem.Name = "StateHistoryIntegrityCheckMenuItem"; + this.StateHistoryIntegrityCheckMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.I))); - this.GreenZoneIntegrityCheckMenuItem.Size = new System.Drawing.Size(282, 22); - this.GreenZoneIntegrityCheckMenuItem.Text = "Greenzone Integrity Check"; - this.GreenZoneIntegrityCheckMenuItem.Click += new System.EventHandler(this.GreenZoneIntegrityCheckMenuItem_Click); + this.StateHistoryIntegrityCheckMenuItem.Size = new System.Drawing.Size(293, 22); + this.StateHistoryIntegrityCheckMenuItem.Text = "State History Integrity Check"; + this.StateHistoryIntegrityCheckMenuItem.Click += new System.EventHandler(this.StateHistoryIntegrityCheckMenuItem_Click); // // ConfigSubMenu // @@ -1089,27 +1089,34 @@ namespace BizHawk.Client.EmuHawk this.AddMarkerContextMenuItem, this.RemoveMarkerContextMenuItem}); this.MarkerContextMenu.Name = "MarkerContextMenu"; - this.MarkerContextMenu.Size = new System.Drawing.Size(153, 114); + this.MarkerContextMenu.Size = new System.Drawing.Size(121, 92); this.MarkerContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.MarkerContextMenu_Opening); // + // ScrollToMarkerToolStripMenuItem + // + this.ScrollToMarkerToolStripMenuItem.Name = "ScrollToMarkerToolStripMenuItem"; + this.ScrollToMarkerToolStripMenuItem.Size = new System.Drawing.Size(120, 22); + this.ScrollToMarkerToolStripMenuItem.Text = "Scroll To"; + this.ScrollToMarkerToolStripMenuItem.Click += new System.EventHandler(this.ScrollToMarkerToolStripMenuItem_Click); + // // EditMarkerContextMenuItem // this.EditMarkerContextMenuItem.Name = "EditMarkerContextMenuItem"; - this.EditMarkerContextMenuItem.Size = new System.Drawing.Size(152, 22); + this.EditMarkerContextMenuItem.Size = new System.Drawing.Size(120, 22); this.EditMarkerContextMenuItem.Text = "Edit"; this.EditMarkerContextMenuItem.Click += new System.EventHandler(this.EditMarkerContextMenuItem_Click); // // AddMarkerContextMenuItem // this.AddMarkerContextMenuItem.Name = "AddMarkerContextMenuItem"; - this.AddMarkerContextMenuItem.Size = new System.Drawing.Size(152, 22); + this.AddMarkerContextMenuItem.Size = new System.Drawing.Size(120, 22); this.AddMarkerContextMenuItem.Text = "Add"; this.AddMarkerContextMenuItem.Click += new System.EventHandler(this.AddMarkerContextMenuItem_Click); // // RemoveMarkerContextMenuItem // this.RemoveMarkerContextMenuItem.Name = "RemoveMarkerContextMenuItem"; - this.RemoveMarkerContextMenuItem.Size = new System.Drawing.Size(152, 22); + this.RemoveMarkerContextMenuItem.Size = new System.Drawing.Size(120, 22); this.RemoveMarkerContextMenuItem.Text = "Remove"; this.RemoveMarkerContextMenuItem.Click += new System.EventHandler(this.RemoveMarkerContextMenuItem_Click); // @@ -1316,13 +1323,6 @@ namespace BizHawk.Client.EmuHawk this.groupBox1.TabStop = false; this.groupBox1.Text = "Markers"; // - // scrollToToolStripMenuItem - // - this.ScrollToMarkerToolStripMenuItem.Name = "scrollToToolStripMenuItem"; - this.ScrollToMarkerToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.ScrollToMarkerToolStripMenuItem.Text = "Scroll To"; - this.ScrollToMarkerToolStripMenuItem.Click += new System.EventHandler(this.ScrollToMarkerToolStripMenuItem_Click); - // // TAStudio // this.AllowDrop = true; @@ -1445,7 +1445,7 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem TruncateContextMenuItem; private System.Windows.Forms.ToolStripMenuItem ClearGreenzoneMenuItem; private System.Windows.Forms.ToolStripSeparator GreenzoneICheckSeparator; - private System.Windows.Forms.ToolStripMenuItem GreenZoneIntegrityCheckMenuItem; + private System.Windows.Forms.ToolStripMenuItem StateHistoryIntegrityCheckMenuItem; private System.Windows.Forms.ToolStripMenuItem ColumnsSubMenu; private System.Windows.Forms.ToolStripSeparator toolStripSeparator19; private System.Windows.Forms.ToolStripSeparator toolStripSeparator21; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index ad24b1e329..3d59f2d847 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -191,7 +191,6 @@ namespace BizHawk.Client.EmuHawk } catch (Exception ex) { - System.Diagnostics.Debugger.Break(); text = string.Empty; MessageBox.Show("oops\n" + ex); } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index f30fae7330..7c7ca6a5b0 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -217,7 +217,7 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie != null && CurrentTasMovie.TasStateManager.Any(); GreenzoneICheckSeparator.Visible = - GreenZoneIntegrityCheckMenuItem.Visible = + StateHistoryIntegrityCheckMenuItem.Visible = VersionInfo.DeveloperBuild; } @@ -593,17 +593,18 @@ namespace BizHawk.Client.EmuHawk RefreshDialog(); } - private void GreenZoneIntegrityCheckMenuItem_Click(object sender, EventArgs e) + private void StateHistoryIntegrityCheckMenuItem_Click(object sender, EventArgs e) { if (!Emulator.DeterministicEmulation) { - if (MessageBox.Show("The emulator is not deterministic. It will likely fail, even if the difference isn't enough to cause a desync.\nContinue with check?", "Not Deterministic", MessageBoxButtons.YesNo) + if (MessageBox.Show("The emulator is not deterministic. It might fail even if the difference isn't enough to cause a desync.\nContinue with check?", "Not Deterministic", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) return; } GoToFrame(0); int lastState = 0; + int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame; do { GlobalWin.MainForm.FrameAdvance(); @@ -621,7 +622,7 @@ namespace BizHawk.Client.EmuHawk lastState = Emulator.Frame; } - } while (Global.Emulator.Frame < CurrentTasMovie.InputLogLength - 1); + } while (Global.Emulator.Frame < goToFrame); MessageBox.Show("Integrity Check passed"); }