Ram Search - introduce "Fast Mode" in order to support large domains such as for N64. In fast mode, the previous value will be defined as last search (or original value), and change counts will not be incremented but the previous value/change counts will not be processed saving huge amounts of processing.

This commit is contained in:
adelikat 2013-06-30 21:50:17 +00:00
parent e1212c75e3
commit cbb35fc3ce
4 changed files with 51 additions and 17 deletions

View File

@ -505,6 +505,7 @@ namespace BizHawk.MultiClient
public int RamSearchValueIndex = 1;
public int RamSearchPrevIndex = 2;
public int RamSearchChangesIndex = 3;
public bool RamSearchFastMode = false;
// HexEditor Settings
public bool AutoLoadHexEditor = false;

View File

@ -86,12 +86,15 @@
this.addSelectedToRamWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pokeAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.freezeAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.clearUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.definePreviousValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sinceLastSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.originalValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sinceLastFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sinceLastChangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fastModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.previewModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.alwaysExcludeRamSearchListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadDialogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -145,8 +148,6 @@
this.MemDomainLabel = new System.Windows.Forms.Label();
this.MessageLabel = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.clearUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SearchtoolStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
@ -675,10 +676,23 @@
this.freezeAddressToolStripMenuItem.Text = "Freeze Address";
this.freezeAddressToolStripMenuItem.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(212, 6);
//
// clearUndoHistoryToolStripMenuItem
//
this.clearUndoHistoryToolStripMenuItem.Name = "clearUndoHistoryToolStripMenuItem";
this.clearUndoHistoryToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.clearUndoHistoryToolStripMenuItem.Text = "Clear Undo History";
this.clearUndoHistoryToolStripMenuItem.Click += new System.EventHandler(this.clearUndoHistoryToolStripMenuItem_Click);
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.definePreviousValueToolStripMenuItem,
this.fastModeToolStripMenuItem,
this.previewModeToolStripMenuItem,
this.alwaysExcludeRamSearchListToolStripMenuItem,
this.autoloadDialogToolStripMenuItem,
@ -731,6 +745,13 @@
this.sinceLastChangeToolStripMenuItem.Text = "Since last Change";
this.sinceLastChangeToolStripMenuItem.Click += new System.EventHandler(this.sinceLastChangeToolStripMenuItem_Click);
//
// fastModeToolStripMenuItem
//
this.fastModeToolStripMenuItem.Name = "fastModeToolStripMenuItem";
this.fastModeToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
this.fastModeToolStripMenuItem.Text = "Fast Mode";
this.fastModeToolStripMenuItem.Click += new System.EventHandler(this.fastModeToolStripMenuItem_Click);
//
// previewModeToolStripMenuItem
//
this.previewModeToolStripMenuItem.Name = "previewModeToolStripMenuItem";
@ -1256,18 +1277,6 @@
this.MessageLabel.TabIndex = 9;
this.MessageLabel.Text = " ";
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(212, 6);
//
// clearUndoHistoryToolStripMenuItem
//
this.clearUndoHistoryToolStripMenuItem.Name = "clearUndoHistoryToolStripMenuItem";
this.clearUndoHistoryToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.clearUndoHistoryToolStripMenuItem.Text = "Clear Undo History";
this.clearUndoHistoryToolStripMenuItem.Click += new System.EventHandler(this.clearUndoHistoryToolStripMenuItem_Click);
//
// RamSearch
//
this.AllowDrop = true;
@ -1431,5 +1440,6 @@
private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem clearUndoHistoryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fastModeToolStripMenuItem;
}
}

View File

@ -77,10 +77,14 @@ namespace BizHawk.MultiClient
sortReverse = false;
sortedCol = "";
for (int x = Searches.Count - 1; x >= 0; x--)
if (!Global.Config.RamSearchFastMode)
{
Searches[x].PeekAddress();
for (int x = Searches.Count - 1; x >= 0; x--)
{
Searches[x].PeekAddress();
}
}
if (AutoSearchCheckBox.Checked)
{
DoSearch();
@ -690,6 +694,14 @@ namespace BizHawk.MultiClient
private void DoSearch()
{
if (Global.Config.RamSearchFastMode)
{
for (int x = Searches.Count - 1; x >= 0; x--)
{
Searches[x].PeekAddress();
}
}
if (GenerateWeedOutList())
{
MessageLabel.Text = MakeAddressString(Searches.Count(x => x.Deleted)) + " removed";
@ -1887,6 +1899,7 @@ namespace BizHawk.MultiClient
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
fastModeToolStripMenuItem.Checked = Global.Config.RamSearchFastMode;
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition;
previewModeToolStripMenuItem.Checked = Global.Config.RamSearchPreviewMode;
alwaysExcludeRamSearchListToolStripMenuItem.Checked = Global.Config.AlwaysExcludeRamWatch;
@ -2706,5 +2719,15 @@ namespace BizHawk.MultiClient
{
SearchHistory.Clear();
}
private void fastModeToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RamSearchFastMode ^= true;
Global.Config.RamSearchPreviewMode = !Global.Config.RamSearchFastMode;
if (Global.Config.RamSearchFastMode && Global.Config.RamSearchPreviousAs > 1)
{
Global.Config.RamSearchPreviousAs = 0;
}
}
}
}

View File

@ -82,7 +82,7 @@ namespace BizHawk.MultiClient
public string Notes;
public int Changecount;
public bool Deleted;
#endregion
#region Properties