diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index e2445f63b8..c4120e7f1c 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -56,6 +56,7 @@ public int RamWatchHeight = -1; public bool RamWatchShowChangeColumn = true; public bool RamWatchShowPrevColumn = false; + public bool RamWatchShowChangeFromPrev = true; // RamSearch Settings public bool AutoLoadRamSearch = false; diff --git a/BizHawk.MultiClient/tools/RamWatch.Designer.cs b/BizHawk.MultiClient/tools/RamWatch.Designer.cs index daf0569ae3..0bed6f3b8e 100644 --- a/BizHawk.MultiClient/tools/RamWatch.Designer.cs +++ b/BizHawk.MultiClient/tools/RamWatch.Designer.cs @@ -57,6 +57,7 @@ this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.showChangeCountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.showPreviousValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.WatchListView = new BizHawk.VirtualListView(); this.Address = new System.Windows.Forms.ColumnHeader(); @@ -90,7 +91,7 @@ this.MoveDownStripButton1 = new System.Windows.Forms.ToolStripButton(); this.WatchCountLabel = new System.Windows.Forms.Label(); this.MessageLabel = new System.Windows.Forms.Label(); - this.showPreviousValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.prevValueShowsChangeAmountToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); @@ -312,24 +313,33 @@ this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.showChangeCountsToolStripMenuItem, this.showPreviousValueToolStripMenuItem, - this.restoreWindowSizeToolStripMenuItem}); + this.restoreWindowSizeToolStripMenuItem, + this.prevValueShowsChangeAmountToolStripMenuItem}); this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.optionsToolStripMenuItem.Text = "&Options"; + this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened); // // showChangeCountsToolStripMenuItem // this.showChangeCountsToolStripMenuItem.Checked = true; this.showChangeCountsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.showChangeCountsToolStripMenuItem.Name = "showChangeCountsToolStripMenuItem"; - this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(210, 22); this.showChangeCountsToolStripMenuItem.Text = "Show Change Counts"; this.showChangeCountsToolStripMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click); // + // showPreviousValueToolStripMenuItem + // + this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem"; + this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.showPreviousValueToolStripMenuItem.Text = "Show Previous Value"; + this.showPreviousValueToolStripMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); + // // restoreWindowSizeToolStripMenuItem // this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem"; - this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(210, 22); this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size"; this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click); // @@ -635,12 +645,12 @@ this.MessageLabel.TabIndex = 5; this.MessageLabel.Text = " "; // - // showPreviousValueToolStripMenuItem + // prevValueShowsChangeAmountToolStripMenuItem // - this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem"; - this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(188, 22); - this.showPreviousValueToolStripMenuItem.Text = "Show Previous Value"; - this.showPreviousValueToolStripMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); + this.prevValueShowsChangeAmountToolStripMenuItem.Name = "prevValueShowsChangeAmountToolStripMenuItem"; + this.prevValueShowsChangeAmountToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.prevValueShowsChangeAmountToolStripMenuItem.Text = "Prev Value - Show change"; + this.prevValueShowsChangeAmountToolStripMenuItem.Click += new System.EventHandler(this.prevValueShowsChangeAmountToolStripMenuItem_Click); // // RamWatch // @@ -736,5 +746,6 @@ private System.Windows.Forms.ToolStripMenuItem showChangeCountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showPreviousValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem prevValueShowsChangeAmountToolStripMenuItem; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index f4e6bd457b..5fd38418be 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -21,7 +21,7 @@ namespace BizHawk.MultiClient //DisplayWatches needs to do value display properly like updatevalues, or just run update values //Ability to watch in different memory domains //Save column widths in config - //Option for Prev to show change (+2 or -2) etc + //Column options in context menu int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired int defaultHeight; @@ -130,28 +130,39 @@ namespace BizHawk.MultiClient text = ""; else { - switch (watchList[index].signed) + if (Global.Config.RamWatchShowChangeFromPrev) { - case asigned.HEX: - switch (watchList[index].type) - { - case atype.BYTE: - text = String.Format("{0:X2}", watchList[index].prev); - break; - case atype.WORD: - text = String.Format("{0:X4}", watchList[index].prev); - break; - case atype.DWORD: - text = String.Format("{0:X8}", watchList[index].prev); - break; - } - break; - case asigned.SIGNED: - text = ((sbyte)watchList[index].prev).ToString(); - break; - case asigned.UNSIGNED: - text = watchList[index].prev.ToString(); - break; + int x = watchList[index].value - watchList[index].prev; + if (x < 0) + text = x.ToString(); + else + text = "+" + x.ToString(); + } + else + { + switch (watchList[index].signed) + { + case asigned.HEX: + switch (watchList[index].type) + { + case atype.BYTE: + text = String.Format("{0:X2}", watchList[index].prev); + break; + case atype.WORD: + text = String.Format("{0:X4}", watchList[index].prev); + break; + case atype.DWORD: + text = String.Format("{0:X8}", watchList[index].prev); + break; + } + break; + case asigned.SIGNED: + text = ((sbyte)watchList[index].prev).ToString(); + break; + case asigned.UNSIGNED: + text = watchList[index].prev.ToString(); + break; + } } } } @@ -971,5 +982,16 @@ namespace BizHawk.MultiClient Global.Config.RamWatchShowPrevColumn ^= true; SetPrevColumn(Global.Config.RamWatchShowPrevColumn); } + + private void prevValueShowsChangeAmountToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RamWatchShowChangeFromPrev ^= true; + DisplayWatchList(); + } + + private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + prevValueShowsChangeAmountToolStripMenuItem.Checked = Global.Config.RamWatchShowChangeFromPrev; + } } } \ No newline at end of file