Ram Watch - major speed up of the preview feature especially with large memory domains, got a 30fps boost on gens system bus. THere is still a lot of code to clean up as a result, and I touched everything about the search feature so there may be regressions in this commit.
This commit is contained in:
parent
7bc1e88d1d
commit
0e02fd7ee4
|
@ -22,7 +22,7 @@ namespace BizHawk.MultiClient
|
||||||
string systemID = "NULL";
|
string systemID = "NULL";
|
||||||
List<Watch> searchList = new List<Watch>();
|
List<Watch> searchList = new List<Watch>();
|
||||||
List<Watch> undoList = new List<Watch>();
|
List<Watch> undoList = new List<Watch>();
|
||||||
List<Watch> weededList = new List<Watch>(); //When addresses are weeded out, the new list goes here, before going into searchList
|
//List<Watch> weededList = new List<Watch>(); //When addresses are weeded out, the new list goes here, before going into searchList
|
||||||
List<Watch> redoList = new List<Watch>();
|
List<Watch> redoList = new List<Watch>();
|
||||||
private bool IsAWeededList = false; //For deciding whether the weeded list is relevant (0 size could mean all were removed in a legit preview
|
private bool IsAWeededList = false; //For deciding whether the weeded list is relevant (0 size could mean all were removed in a legit preview
|
||||||
List<ToolStripMenuItem> domainMenuItems = new List<ToolStripMenuItem>();
|
List<ToolStripMenuItem> domainMenuItems = new List<ToolStripMenuItem>();
|
||||||
|
@ -72,17 +72,25 @@ namespace BizHawk.MultiClient
|
||||||
if (!this.IsHandleCreated || this.IsDisposed) return;
|
if (!this.IsHandleCreated || this.IsDisposed) return;
|
||||||
|
|
||||||
if (searchList.Count > 8)
|
if (searchList.Count > 8)
|
||||||
|
{
|
||||||
SearchListView.BlazingFast = true;
|
SearchListView.BlazingFast = true;
|
||||||
|
}
|
||||||
|
|
||||||
sortReverse = false;
|
sortReverse = false;
|
||||||
sortedCol = "";
|
sortedCol = "";
|
||||||
|
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
searchList[x].PeekAddress(Domain);
|
searchList[x].PeekAddress(Domain);
|
||||||
}
|
}
|
||||||
if (AutoSearchCheckBox.Checked)
|
if (AutoSearchCheckBox.Checked)
|
||||||
|
{
|
||||||
DoSearch();
|
DoSearch();
|
||||||
|
}
|
||||||
else if (Global.Config.RamSearchPreviewMode)
|
else if (Global.Config.RamSearchPreviewMode)
|
||||||
|
{
|
||||||
DoPreview();
|
DoPreview();
|
||||||
|
}
|
||||||
|
|
||||||
SearchListView.Refresh();
|
SearchListView.Refresh();
|
||||||
SearchListView.BlazingFast = false;
|
SearchListView.BlazingFast = false;
|
||||||
|
@ -371,7 +379,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
ClearUndo();
|
ClearUndo();
|
||||||
ClearRedo();
|
ClearRedo();
|
||||||
weededList.Clear();
|
//weededList.Clear();
|
||||||
IsAWeededList = false;
|
IsAWeededList = false;
|
||||||
searchList.Clear();
|
searchList.Clear();
|
||||||
SetPlatformAndMemoryDomainLabel();
|
SetPlatformAndMemoryDomainLabel();
|
||||||
|
@ -518,8 +526,9 @@ namespace BizHawk.MultiClient
|
||||||
private void SaveUndo()
|
private void SaveUndo()
|
||||||
{
|
{
|
||||||
undoList.Clear();
|
undoList.Clear();
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
//for (int x = 0; x < searchList.Count; x++) //TODO: delete
|
||||||
undoList.Add(new Watch(searchList[x]));
|
// undoList.Add(new Watch(searchList[x]));
|
||||||
|
undoList.AddRange(searchList.Where(x => x.deleted == false));
|
||||||
UndotoolStripButton.Enabled = true;
|
UndotoolStripButton.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,7 +583,8 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (IsAWeededList && column == 0)
|
if (IsAWeededList && column == 0)
|
||||||
{
|
{
|
||||||
if (!weededList.Contains(searchList[index]))
|
//if (!weededList.Contains(searchList[index])) //TODO: delete me
|
||||||
|
if (searchList[index].deleted)
|
||||||
{
|
{
|
||||||
if (color == Color.Pink) return;
|
if (color == Color.Pink) return;
|
||||||
if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address))
|
if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address))
|
||||||
|
@ -583,7 +593,9 @@ namespace BizHawk.MultiClient
|
||||||
color = Color.Pink;
|
color = Color.Pink;
|
||||||
}
|
}
|
||||||
else if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address))
|
else if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address))
|
||||||
|
{
|
||||||
color = Color.LightCyan;
|
color = Color.LightCyan;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (color == Color.White) return;
|
if (color == Color.White) return;
|
||||||
|
@ -650,12 +662,13 @@ namespace BizHawk.MultiClient
|
||||||
DoUndo();
|
DoUndo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReplaceSearchListWithWeedOutList()
|
//adelikat: This is now obsolete, if you need a weeded list, look for non-deleted
|
||||||
{
|
//private void ReplaceSearchListWithWeedOutList()
|
||||||
searchList = new List<Watch>(weededList);
|
//{
|
||||||
weededList.Clear();
|
// searchList = new List<Watch>(weededList);
|
||||||
IsAWeededList = false;
|
// weededList.Clear();
|
||||||
}
|
// IsAWeededList = false;
|
||||||
|
//}
|
||||||
|
|
||||||
private void DoPreview()
|
private void DoPreview()
|
||||||
{
|
{
|
||||||
|
@ -670,8 +683,8 @@ namespace BizHawk.MultiClient
|
||||||
if (GenerateWeedOutList())
|
if (GenerateWeedOutList())
|
||||||
{
|
{
|
||||||
SaveUndo();
|
SaveUndo();
|
||||||
MessageLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " removed";
|
MessageLabel.Text = MakeAddressString(searchList.Where(x => x.deleted == true).Count()) + " removed";
|
||||||
ReplaceSearchListWithWeedOutList();
|
//ReplaceSearchListWithWeedOutList(); //TODO: delete me
|
||||||
UpdateLastSearch();
|
UpdateLastSearch();
|
||||||
DisplaySearchList();
|
DisplaySearchList();
|
||||||
}
|
}
|
||||||
|
@ -724,7 +737,7 @@ namespace BizHawk.MultiClient
|
||||||
//Generate search list
|
//Generate search list
|
||||||
//Use search list to generate a list of flagged address (for displaying pink)
|
//Use search list to generate a list of flagged address (for displaying pink)
|
||||||
IsAWeededList = true;
|
IsAWeededList = true;
|
||||||
weededList.Clear();
|
//weededList.Clear(); TODO: delete this
|
||||||
switch (GetCompareTo())
|
switch (GetCompareTo())
|
||||||
{
|
{
|
||||||
case SCompareTo.PREV:
|
case SCompareTo.PREV:
|
||||||
|
@ -767,12 +780,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) < searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) < searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) < searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) < searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -783,12 +808,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) > searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) > searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) > searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) > searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -799,12 +836,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) <= searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) <= searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) <= searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) <= searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -815,12 +864,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) >= searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) >= searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) >= searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) >= searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -831,12 +892,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -847,12 +920,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) != searchList[x].SignedVal(previous))
|
if (searchList[x].SignedVal(searchList[x].value) != searchList[x].SignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) != searchList[x].UnsignedVal(previous))
|
if (searchList[x].UnsignedVal(searchList[x].value) != searchList[x].UnsignedVal(previous))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -865,12 +950,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous) + diff || searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous) - diff)
|
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous) + diff || searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal(previous) - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous) + diff || searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous) - diff)
|
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous) + diff || searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal(previous) - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -902,12 +999,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) < searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) < searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) < searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) < searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -917,12 +1026,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) > searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) > searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) > searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) > searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -932,12 +1053,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) <= searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) <= searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) <= searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) <= searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -947,12 +1080,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) >= searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) >= searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) >= searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) >= searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -962,12 +1107,25 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -977,12 +1135,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) != searchList[x].SignedVal((int)value))
|
if (searchList[x].SignedVal(searchList[x].value) != searchList[x].SignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) != searchList[x].UnsignedVal((int)value))
|
if (searchList[x].UnsignedVal(searchList[x].value) != searchList[x].UnsignedVal((int)value))
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -994,12 +1164,24 @@ namespace BizHawk.MultiClient
|
||||||
if (searchList[x].signed == asigned.SIGNED)
|
if (searchList[x].signed == asigned.SIGNED)
|
||||||
{
|
{
|
||||||
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value) + diff || searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value) - diff)
|
if (searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value) + diff || searchList[x].SignedVal(searchList[x].value) == searchList[x].SignedVal((int)value) - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value) + diff || searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value) - diff)
|
if (searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value) + diff || searchList[x].UnsignedVal(searchList[x].value) == searchList[x].UnsignedVal((int)value) - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1082,42 +1264,78 @@ namespace BizHawk.MultiClient
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address < address)
|
if (searchList[x].address < address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.GREATER:
|
case SOperator.GREATER:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address > address)
|
if (searchList[x].address > address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.LESSEQUAL:
|
case SOperator.LESSEQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address <= address)
|
if (searchList[x].address <= address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.GREATEREQUAL:
|
case SOperator.GREATEREQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address >= address)
|
if (searchList[x].address >= address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.EQUAL:
|
case SOperator.EQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address == address)
|
if (searchList[x].address == address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.NOTEQUAL:
|
case SOperator.NOTEQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address != address)
|
if (searchList[x].address != address)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.DIFFBY:
|
case SOperator.DIFFBY:
|
||||||
|
@ -1127,7 +1345,13 @@ namespace BizHawk.MultiClient
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address == address + diff || searchList[x].address == address - diff)
|
if (searchList[x].address == address + diff || searchList[x].address == address - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1160,42 +1384,78 @@ namespace BizHawk.MultiClient
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount < changes)
|
if (searchList[x].changecount < changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.GREATER:
|
case SOperator.GREATER:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount > changes)
|
if (searchList[x].changecount > changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.LESSEQUAL:
|
case SOperator.LESSEQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount <= changes)
|
if (searchList[x].changecount <= changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.GREATEREQUAL:
|
case SOperator.GREATEREQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount >= changes)
|
if (searchList[x].changecount >= changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.EQUAL:
|
case SOperator.EQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount == changes)
|
if (searchList[x].changecount == changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.NOTEQUAL:
|
case SOperator.NOTEQUAL:
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].changecount != changes)
|
if (searchList[x].changecount != changes)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOperator.DIFFBY:
|
case SOperator.DIFFBY:
|
||||||
|
@ -1204,7 +1464,13 @@ namespace BizHawk.MultiClient
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
if (searchList[x].address == changes + diff || searchList[x].address == changes - diff)
|
if (searchList[x].address == changes + diff || searchList[x].address == changes - diff)
|
||||||
weededList.Add(searchList[x]);
|
{
|
||||||
|
searchList[x].deleted = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchList[x].deleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1217,8 +1483,8 @@ namespace BizHawk.MultiClient
|
||||||
searchList[x].signed = s;
|
searchList[x].signed = s;
|
||||||
for (int x = 0; x < undoList.Count; x++)
|
for (int x = 0; x < undoList.Count; x++)
|
||||||
undoList[x].signed = s;
|
undoList[x].signed = s;
|
||||||
for (int x = 0; x < weededList.Count; x++)
|
//for (int x = 0; x < weededList.Count; x++) //TODO: delete me
|
||||||
weededList[x].signed = s;
|
// weededList[x].signed = s;
|
||||||
for (int x = 0; x < redoList.Count; x++)
|
for (int x = 0; x < redoList.Count; x++)
|
||||||
redoList[x].signed = s;
|
redoList[x].signed = s;
|
||||||
SetSpecificValueBoxMaxLength();
|
SetSpecificValueBoxMaxLength();
|
||||||
|
@ -1231,7 +1497,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
ConvertDataSize(s, bigendian, ref searchList);
|
ConvertDataSize(s, bigendian, ref searchList);
|
||||||
ConvertDataSize(s, bigendian, ref undoList);
|
ConvertDataSize(s, bigendian, ref undoList);
|
||||||
ConvertDataSize(s, bigendian, ref weededList);
|
//ConvertDataSize(s, bigendian, ref weededList); //TODO: delete me
|
||||||
ConvertDataSize(s, bigendian, ref redoList);
|
ConvertDataSize(s, bigendian, ref redoList);
|
||||||
SetSpecificValueBoxMaxLength();
|
SetSpecificValueBoxMaxLength();
|
||||||
sortReverse = false;
|
sortReverse = false;
|
||||||
|
@ -1841,26 +2107,33 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void DoTruncate(List<Watch> temp)
|
private void DoTruncate(List<Watch> temp)
|
||||||
{
|
{
|
||||||
weededList.Clear();
|
|
||||||
bool found = false;
|
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
|
||||||
{
|
|
||||||
found = false;
|
|
||||||
for (int y = 0; y < temp.Count; y++)
|
|
||||||
{
|
|
||||||
if (searchList[x].address == temp[y].address)
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
//weededList.Clear(); //TODO: delete
|
||||||
if (!found)
|
//bool found = false;
|
||||||
weededList.Add(searchList[x]);
|
//for (int x = 0; x < searchList.Count; x++)
|
||||||
}
|
//{
|
||||||
SaveUndo();
|
// found = false;
|
||||||
MessageLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " removed";
|
// for (int y = 0; y < temp.Count; y++)
|
||||||
ReplaceSearchListWithWeedOutList();
|
// {
|
||||||
|
// if (searchList[x].address == temp[y].address)
|
||||||
|
// {
|
||||||
|
// found = true;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// if (!found)
|
||||||
|
// {
|
||||||
|
// //weededList.Add(searchList[x]);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
SaveUndo(); //TODO: we need to undo!
|
||||||
|
MessageLabel.Text = MakeAddressString(undoList.Count) + " removed";
|
||||||
|
searchList = searchList.Where(x => x.deleted == false).ToList();
|
||||||
|
|
||||||
|
//MessageLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " removed"; //TODO: delete
|
||||||
|
//ReplaceSearchListWithWeedOutList(); //TODO: delete this
|
||||||
UpdateLastSearch();
|
UpdateLastSearch();
|
||||||
DisplaySearchList();
|
DisplaySearchList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace BizHawk.MultiClient
|
||||||
original = 0;
|
original = 0;
|
||||||
lastchange = 0;
|
lastchange = 0;
|
||||||
lastsearch = 0;
|
lastsearch = 0;
|
||||||
|
deleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Watch(Watch w)
|
public Watch(Watch w)
|
||||||
|
@ -42,6 +43,7 @@ namespace BizHawk.MultiClient
|
||||||
original = w.original;
|
original = w.original;
|
||||||
lastchange = w.lastchange;
|
lastchange = w.lastchange;
|
||||||
lastsearch = w.lastsearch;
|
lastsearch = w.lastsearch;
|
||||||
|
deleted = w.deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes)
|
public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes)
|
||||||
|
@ -73,6 +75,7 @@ namespace BizHawk.MultiClient
|
||||||
public bool bigendian { get; set; }
|
public bool bigendian { get; set; }
|
||||||
public string notes { get; set; } //User notes
|
public string notes { get; set; } //User notes
|
||||||
public int changecount { get; set; }
|
public int changecount { get; set; }
|
||||||
|
public bool deleted { get; set; } //For weeding out addresses in things like ram search, without actually removing them from the list (in order to preview, undo, etc)
|
||||||
|
|
||||||
|
|
||||||
public bool SetTypeByChar(char c) //b = byte, w = word, d = dword
|
public bool SetTypeByChar(char c) //b = byte, w = word, d = dword
|
||||||
|
|
Loading…
Reference in New Issue