From a8b1fc609aa45e4d68480f78bad8006fe89c9e5f Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 19 Jan 2015 02:04:04 +0000 Subject: [PATCH] Ram Poke - handle the case of an absurd amount of addresses picked --- BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs index 6d3f942cdb..2e805b676d 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs @@ -61,7 +61,22 @@ namespace BizHawk.Client.EmuHawk } AddressBox.SetHexProperties(_watchList[0].Domain.Size); - AddressBox.Text = _watchList.Select(a => a.AddressString).Distinct().Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); + if (_watchList.Count < 10) // Hack in case an asburd amount of addresses is picked, this can get slow and create a too long string + { + AddressBox.Text = _watchList + .Select(a => a.AddressString) + .Distinct() + .Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); + } + else + { + AddressBox.Text = _watchList + .Take(10) + .Select(a => a.AddressString) + .Distinct() + .Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); + } + ValueHexLabel.Text = _watchList[0].Type == Watch.DisplayType.Hex ? "0x" : string.Empty; ValueBox.Text = _watchList[0].ValueString.Replace(" ", string.Empty); DomainLabel.Text = _watchList[0].Domain.Name;