From 3e3748f87b24a081d2d4c3cc9741c424f05da5c7 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 13 Sep 2012 02:59:32 +0000 Subject: [PATCH] Ram Poke - on load and signed type change, display the value in the value box accordingly --- BizHawk.MultiClient/tools/RamPoke.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamPoke.cs b/BizHawk.MultiClient/tools/RamPoke.cs index 0154dfb5bf..29e03c4d9d 100644 --- a/BizHawk.MultiClient/tools/RamPoke.cs +++ b/BizHawk.MultiClient/tools/RamPoke.cs @@ -12,8 +12,6 @@ namespace BizHawk.MultiClient { public partial class RamPoke : Form { - //TODO: - //If signed/unsigned/hex radios selected, auto-change the value box public Watch watch = new Watch(); public MemoryDomain domain = Global.Emulator.MainMemory; public Point location = new Point(); @@ -65,6 +63,7 @@ namespace BizHawk.MultiClient UpdateTitleText(); SetDomainSelection(); + FormatValue(); } private void SetValueBox() @@ -347,18 +346,24 @@ namespace BizHawk.MultiClient { ValueHexLabel.Text = "0x"; ValueBox.MaxLength = GetValueNumDigits(); + watch.Signed = Watch.DISPTYPE.HEX; + FormatValue(); } private void UnsignedRadio_Click(object sender, EventArgs e) { ValueHexLabel.Text = ""; ValueBox.MaxLength = GetValueNumDigits(); + watch.Signed = Watch.DISPTYPE.UNSIGNED; + FormatValue(); } private void SignedRadio_Click(object sender, EventArgs e) { ValueHexLabel.Text = ""; ValueBox.MaxLength = GetValueNumDigits(); + watch.Signed = Watch.DISPTYPE.SIGNED; + FormatValue(); } private int GetValueNumDigits() @@ -431,5 +436,10 @@ namespace BizHawk.MultiClient DomainComboBox.SelectedIndex = x; } } + + private void FormatValue() + { + ValueBox.Text = watch.ValueString; + } } }