-Cleared the sorted column whenever the previous definition, data size, data type, or endian changes because these options might place the values out of order.
--Well, data size and endian don't, but they will once these changes take effect in the middle of a search. -Previous can now be defined as the last change, fixing the enhancement shown in Issue 73 (Ram Watch equivalent might come later). -Fixed unsigned sort.
This commit is contained in:
parent
f02d28fb38
commit
720193b50f
|
@ -140,6 +140,7 @@
|
|||
this.MemDomainLabel = new System.Windows.Forms.Label();
|
||||
this.MessageLabel = new System.Windows.Forms.Label();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.sinceLastChangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SearchtoolStrip1.SuspendLayout();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
|
@ -672,7 +673,8 @@
|
|||
this.definePreviousValueToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.sinceLastSearchToolStripMenuItem,
|
||||
this.originalValueToolStripMenuItem,
|
||||
this.sinceLastFrameToolStripMenuItem});
|
||||
this.sinceLastFrameToolStripMenuItem,
|
||||
this.sinceLastChangeToolStripMenuItem});
|
||||
this.definePreviousValueToolStripMenuItem.Name = "definePreviousValueToolStripMenuItem";
|
||||
this.definePreviousValueToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
|
||||
this.definePreviousValueToolStripMenuItem.Text = "Define Previous Value As";
|
||||
|
@ -681,21 +683,21 @@
|
|||
// sinceLastSearchToolStripMenuItem
|
||||
//
|
||||
this.sinceLastSearchToolStripMenuItem.Name = "sinceLastSearchToolStripMenuItem";
|
||||
this.sinceLastSearchToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.sinceLastSearchToolStripMenuItem.Size = new System.Drawing.Size(167, 22);
|
||||
this.sinceLastSearchToolStripMenuItem.Text = "Since last Search";
|
||||
this.sinceLastSearchToolStripMenuItem.Click += new System.EventHandler(this.sinceLastSearchToolStripMenuItem_Click);
|
||||
//
|
||||
// originalValueToolStripMenuItem
|
||||
//
|
||||
this.originalValueToolStripMenuItem.Name = "originalValueToolStripMenuItem";
|
||||
this.originalValueToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.originalValueToolStripMenuItem.Size = new System.Drawing.Size(167, 22);
|
||||
this.originalValueToolStripMenuItem.Text = "Original value";
|
||||
this.originalValueToolStripMenuItem.Click += new System.EventHandler(this.originalValueToolStripMenuItem_Click);
|
||||
//
|
||||
// sinceLastFrameToolStripMenuItem
|
||||
//
|
||||
this.sinceLastFrameToolStripMenuItem.Name = "sinceLastFrameToolStripMenuItem";
|
||||
this.sinceLastFrameToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.sinceLastFrameToolStripMenuItem.Size = new System.Drawing.Size(167, 22);
|
||||
this.sinceLastFrameToolStripMenuItem.Text = "Since last Frame";
|
||||
this.sinceLastFrameToolStripMenuItem.Click += new System.EventHandler(this.sinceLastFrameToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -833,9 +835,9 @@
|
|||
this.DataSizetoolStripSplitButton1,
|
||||
this.DataTypetoolStripSplitButton1,
|
||||
this.EndiantoolSplitButton});
|
||||
this.toolStrip2.Location = new System.Drawing.Point(209, 83);
|
||||
this.toolStrip2.Location = new System.Drawing.Point(240, 83);
|
||||
this.toolStrip2.Name = "toolStrip2";
|
||||
this.toolStrip2.Size = new System.Drawing.Size(248, 25);
|
||||
this.toolStrip2.Size = new System.Drawing.Size(217, 25);
|
||||
this.toolStrip2.TabIndex = 10;
|
||||
this.toolStrip2.TabStop = true;
|
||||
//
|
||||
|
@ -1206,6 +1208,13 @@
|
|||
this.MessageLabel.TabIndex = 9;
|
||||
this.MessageLabel.Text = " ";
|
||||
//
|
||||
// sinceLastChangeToolStripMenuItem
|
||||
//
|
||||
this.sinceLastChangeToolStripMenuItem.Name = "sinceLastChangeToolStripMenuItem";
|
||||
this.sinceLastChangeToolStripMenuItem.Size = new System.Drawing.Size(167, 22);
|
||||
this.sinceLastChangeToolStripMenuItem.Text = "Since last Change";
|
||||
this.sinceLastChangeToolStripMenuItem.Click += new System.EventHandler(this.sinceLastChangeToolStripMenuItem_Click);
|
||||
//
|
||||
// RamSearch
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -1362,5 +1371,6 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem viewInHexEditorToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
private System.Windows.Forms.ToolStripMenuItem includeMisalignedToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem sinceLastChangeToolStripMenuItem;
|
||||
}
|
||||
}
|
|
@ -399,6 +399,7 @@ namespace BizHawk.MultiClient
|
|||
searchList[x].PeekAddress(Domain);
|
||||
searchList[x].prev = searchList[x].value;
|
||||
searchList[x].original = searchList[x].value;
|
||||
searchList[x].lastchange = searchList[x].value;
|
||||
searchList[x].lastsearch = searchList[x].value;
|
||||
if (includeMisalignedToolStripMenuItem.Checked)
|
||||
count++;
|
||||
|
@ -613,6 +614,9 @@ namespace BizHawk.MultiClient
|
|||
case 2:
|
||||
text = searchList[index].PrevToString();
|
||||
break;
|
||||
case 3:
|
||||
text = searchList[index].LastChangeToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (column == 3)
|
||||
|
@ -741,6 +745,8 @@ namespace BizHawk.MultiClient
|
|||
default:
|
||||
case 2:
|
||||
return searchList[pos].prev;
|
||||
case 3:
|
||||
return searchList[pos].lastchange;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -883,17 +889,17 @@ namespace BizHawk.MultiClient
|
|||
case asigned.SIGNED:
|
||||
i = InputValidate.IsValidSignedNumber(SpecificValueBox.Text);
|
||||
if (!i) return -99999999;
|
||||
int real = (int)Int64.Parse(SpecificValueBox.Text);
|
||||
int value = (int)Int64.Parse(SpecificValueBox.Text);
|
||||
switch (GetDataSize())
|
||||
{
|
||||
case atype.BYTE:
|
||||
return (int)(byte)real;
|
||||
return (int)(byte)value;
|
||||
case atype.WORD:
|
||||
return (int)(ushort)real;
|
||||
return (int)(ushort)value;
|
||||
case atype.DWORD:
|
||||
return (int)(uint)real;
|
||||
return (int)(uint)value;
|
||||
}
|
||||
return real;
|
||||
return value;
|
||||
case asigned.HEX:
|
||||
i = InputValidate.IsValidHexNumber(SpecificValueBox.Text);
|
||||
if (!i) return -99999999;
|
||||
|
@ -1095,6 +1101,8 @@ namespace BizHawk.MultiClient
|
|||
signedToolStripMenuItem.Checked = true;
|
||||
hexadecimalToolStripMenuItem.Checked = false;
|
||||
ConvertListsDataType(asigned.SIGNED);
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void unsignedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -1107,6 +1115,8 @@ namespace BizHawk.MultiClient
|
|||
signedToolStripMenuItem.Checked = false;
|
||||
hexadecimalToolStripMenuItem.Checked = false;
|
||||
ConvertListsDataType(asigned.UNSIGNED);
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void hexadecimalToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -1119,6 +1129,8 @@ namespace BizHawk.MultiClient
|
|||
signedToolStripMenuItem.Checked = false;
|
||||
hexadecimalToolStripMenuItem.Checked = true;
|
||||
ConvertListsDataType(asigned.HEX);
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void SearchListView_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
|
@ -1196,6 +1208,8 @@ namespace BizHawk.MultiClient
|
|||
byteToolStripMenuItem.Checked = true;
|
||||
bytesToolStripMenuItem.Checked = false;
|
||||
dWordToolStripMenuItem1.Checked = false;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void bytesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -1203,6 +1217,8 @@ namespace BizHawk.MultiClient
|
|||
byteToolStripMenuItem.Checked = false;
|
||||
bytesToolStripMenuItem.Checked = true;
|
||||
dWordToolStripMenuItem1.Checked = false;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void dWordToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
|
@ -1210,18 +1226,31 @@ namespace BizHawk.MultiClient
|
|||
byteToolStripMenuItem.Checked = false;
|
||||
bytesToolStripMenuItem.Checked = false;
|
||||
dWordToolStripMenuItem1.Checked = true;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void includeMisalignedToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
includeMisalignedToolStripMenuItem.Checked ^= true;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void SetLittleEndian()
|
||||
{
|
||||
bigEndianToolStripMenuItem.Checked = false;
|
||||
littleEndianToolStripMenuItem.Checked = true;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void SetBigEndian()
|
||||
{
|
||||
bigEndianToolStripMenuItem.Checked = true;
|
||||
littleEndianToolStripMenuItem.Checked = false;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
}
|
||||
|
||||
private void bigEndianToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -1487,18 +1516,32 @@ namespace BizHawk.MultiClient
|
|||
private void sinceLastSearchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviousAs = 0;
|
||||
DisplaySearchList();
|
||||
}
|
||||
|
||||
private void sinceLastFrameToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviousAs = 2;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
DisplaySearchList();
|
||||
}
|
||||
|
||||
private void originalValueToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviousAs = 1;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
DisplaySearchList();
|
||||
}
|
||||
|
||||
private void sinceLastFrameToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviousAs = 2;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
DisplaySearchList();
|
||||
}
|
||||
|
||||
private void sinceLastChangeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviousAs = 3;
|
||||
sortReverse = false;
|
||||
sortedCol = "";
|
||||
DisplaySearchList();
|
||||
}
|
||||
|
||||
|
@ -1506,21 +1549,30 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
switch (Global.Config.RamSearchPreviousAs)
|
||||
{
|
||||
case 0: //Since last Search
|
||||
sinceLastSearchToolStripMenuItem.Checked = true;
|
||||
originalValueToolStripMenuItem.Checked = false;
|
||||
sinceLastFrameToolStripMenuItem.Checked = false;
|
||||
sinceLastChangeToolStripMenuItem.Checked = false;
|
||||
break;
|
||||
case 1: //Original value (since Start new search)
|
||||
sinceLastSearchToolStripMenuItem.Checked = false;
|
||||
originalValueToolStripMenuItem.Checked = true;
|
||||
sinceLastFrameToolStripMenuItem.Checked = false;
|
||||
sinceLastChangeToolStripMenuItem.Checked = false;
|
||||
break;
|
||||
default:
|
||||
case 2: //Since last Frame
|
||||
sinceLastSearchToolStripMenuItem.Checked = false;
|
||||
originalValueToolStripMenuItem.Checked = false;
|
||||
sinceLastFrameToolStripMenuItem.Checked = true;
|
||||
sinceLastChangeToolStripMenuItem.Checked = false;
|
||||
break;
|
||||
case 0: //Since last Search
|
||||
default:
|
||||
sinceLastSearchToolStripMenuItem.Checked = true;
|
||||
case 3: //Since last Change
|
||||
sinceLastSearchToolStripMenuItem.Checked = false;
|
||||
originalValueToolStripMenuItem.Checked = false;
|
||||
sinceLastFrameToolStripMenuItem.Checked = false;
|
||||
sinceLastChangeToolStripMenuItem.Checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1678,6 +1730,7 @@ namespace BizHawk.MultiClient
|
|||
searchList[x].lastsearch = searchList[x].value;
|
||||
searchList[x].original = searchList[x].value;
|
||||
searchList[x].prev = searchList[x].value;
|
||||
searchList[x].lastchange = searchList[x].value;
|
||||
}
|
||||
DisplaySearchList();
|
||||
DoPreview();
|
||||
|
@ -2009,6 +2062,9 @@ namespace BizHawk.MultiClient
|
|||
case 1:
|
||||
previous = "Original";
|
||||
break;
|
||||
case 3:
|
||||
previous = "Last Change";
|
||||
break;
|
||||
}
|
||||
searchList.Sort((x, y) => x.CompareTo(y, columnName, previous) * (sortReverse ? -1 : 1));
|
||||
sortedCol = columnName;
|
||||
|
@ -2075,10 +2131,5 @@ namespace BizHawk.MultiClient
|
|||
Global.MainForm.HexEditor1.GoToAddress(searchList[indexes[0]].address);
|
||||
}
|
||||
}
|
||||
|
||||
private void includeMisalignedToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
includeMisalignedToolStripMenuItem.Checked ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,6 +244,31 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public int IntegerVal(int val)
|
||||
{
|
||||
if (signed == asigned.SIGNED)
|
||||
switch (type)
|
||||
{
|
||||
case atype.BYTE:
|
||||
return (int)(sbyte)val;
|
||||
case atype.WORD:
|
||||
return (int)(short)val;
|
||||
default:
|
||||
case atype.DWORD:
|
||||
return val;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case atype.BYTE:
|
||||
return (int)(byte)val;
|
||||
case atype.WORD:
|
||||
return (int)(ushort)val;
|
||||
case atype.DWORD:
|
||||
return (int)(uint)val;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (type == atype.SEPARATOR)
|
||||
|
@ -274,29 +299,10 @@ namespace BizHawk.MultiClient
|
|||
case atype.DWORD:
|
||||
return String.Format("{0:X8}", val);
|
||||
}
|
||||
case asigned.SIGNED:
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
case atype.BYTE:
|
||||
return ((sbyte)val).ToString();
|
||||
case atype.WORD:
|
||||
return ((short)val).ToString();
|
||||
case atype.DWORD:
|
||||
return ((int)val).ToString();
|
||||
}
|
||||
default:
|
||||
case asigned.SIGNED:
|
||||
case asigned.UNSIGNED:
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
case atype.BYTE:
|
||||
return ((byte)val).ToString();
|
||||
case atype.WORD:
|
||||
return ((ushort)val).ToString();
|
||||
case atype.DWORD:
|
||||
return ((uint)val).ToString();
|
||||
}
|
||||
return IntegerVal(val).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -338,9 +344,9 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private int CompareValue(Watch Other)
|
||||
{
|
||||
if (this.value < Other.value)
|
||||
if (IntegerVal(this.value) < IntegerVal(Other.value))
|
||||
return -1;
|
||||
else if (this.value > Other.value)
|
||||
else if (IntegerVal(this.value) > IntegerVal(Other.value))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
@ -348,9 +354,9 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private int ComparePrev(Watch Other)
|
||||
{
|
||||
if (this.prev < Other.prev)
|
||||
if (IntegerVal(this.prev) < IntegerVal(Other.prev))
|
||||
return -1;
|
||||
else if (this.prev > Other.prev)
|
||||
else if (IntegerVal(this.prev) > IntegerVal(Other.prev))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
@ -358,7 +364,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private int CompareOriginal(Watch Other)
|
||||
{
|
||||
if (this.original < Other.original)
|
||||
if (IntegerVal(this.original) < IntegerVal(Other.original))
|
||||
return -1;
|
||||
else if (this.original > Other.original)
|
||||
return 1;
|
||||
|
@ -368,7 +374,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private int CompareLastChange(Watch Other)
|
||||
{
|
||||
if (this.lastchange < Other.lastchange)
|
||||
if (IntegerVal(this.lastchange) < IntegerVal(Other.lastchange))
|
||||
return -1;
|
||||
else if (this.lastchange > Other.lastchange)
|
||||
return 1;
|
||||
|
@ -378,7 +384,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private int CompareLastSearch(Watch Other)
|
||||
{
|
||||
if (this.lastsearch < Other.lastsearch)
|
||||
if (IntegerVal(this.lastsearch) < IntegerVal(Other.lastsearch))
|
||||
return -1;
|
||||
else if (this.lastsearch > Other.lastsearch)
|
||||
return 1;
|
||||
|
@ -430,10 +436,13 @@ namespace BizHawk.MultiClient
|
|||
case "Original":
|
||||
compare = CompareOriginal(Other);
|
||||
break;
|
||||
case "Last Frame":
|
||||
default:
|
||||
case "Last Frame":
|
||||
compare = ComparePrev(Other);
|
||||
break;
|
||||
case "Last Change":
|
||||
compare = CompareLastChange(Other);
|
||||
break;
|
||||
}
|
||||
if (compare == 0)
|
||||
compare = CompareNotes(Other);
|
||||
|
@ -461,10 +470,13 @@ namespace BizHawk.MultiClient
|
|||
case "Original":
|
||||
compare = CompareOriginal(Other);
|
||||
break;
|
||||
case "Last Frame":
|
||||
default:
|
||||
case "Last Frame":
|
||||
compare = ComparePrev(Other);
|
||||
break;
|
||||
case "Last Change":
|
||||
compare = CompareLastChange(Other);
|
||||
break;
|
||||
}
|
||||
if (compare == 0)
|
||||
compare = CompareNotes(Other);
|
||||
|
@ -483,10 +495,13 @@ namespace BizHawk.MultiClient
|
|||
case "Original":
|
||||
compare = CompareOriginal(Other);
|
||||
break;
|
||||
case "Last Frame":
|
||||
default:
|
||||
case "Last Frame":
|
||||
compare = ComparePrev(Other);
|
||||
break;
|
||||
case "Last Change":
|
||||
compare = CompareLastChange(Other);
|
||||
break;
|
||||
}
|
||||
if (compare == 0)
|
||||
{
|
||||
|
@ -523,10 +538,13 @@ namespace BizHawk.MultiClient
|
|||
case "Original":
|
||||
compare = CompareOriginal(Other);
|
||||
break;
|
||||
case "Last Frame":
|
||||
default:
|
||||
case "Last Frame":
|
||||
compare = ComparePrev(Other);
|
||||
break;
|
||||
case "Last Change":
|
||||
compare = CompareLastChange(Other);
|
||||
break;
|
||||
}
|
||||
if (compare == 0)
|
||||
compare = CompareNotes(Other);
|
||||
|
|
Loading…
Reference in New Issue