From 85d140c4b5fcc7ad11c758e44f7e275fa93792f2 Mon Sep 17 00:00:00 2001 From: scrimpeh Date: Mon, 22 Jun 2020 21:09:05 +0200 Subject: [PATCH] ram watch: allow duplicate identical ram watches Allows duplicating identical Ram Watches. Previously, the Duplicate Watch dialog would silently discard a new watch if the address didn't change. As a side effect, multiple watches can now be duplicated simulatenously. This commit also removes the check for separate memory domains - it doesn't seem to cause any problems --- .../tools/Watch/WatchList/WatchList.cs | 6 +----- src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index 78ef3fab17..656d680f5a 100644 --- a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -174,17 +174,13 @@ namespace BizHawk.Client.Common /// /// Add an existing collection of into the current one - /// equality will be checked to avoid doubles /// /// of watch to merge public void AddRange(IEnumerable watches) { Parallel.ForEach(watches, watch => { - if (!_watchList.Contains(watch)) - { - _watchList.Add(watch); - } + _watchList.Add(watch); }); Changes = true; } diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 679fa88ddb..e4d1c9ee5a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -350,14 +350,6 @@ namespace BizHawk.Client.EmuHawk if (SelectedWatches.Any()) { - foreach (var sw in SelectedWatches) - { - if (sw.Domain != SelectedWatches.First().Domain) - { - throw new InvalidOperationException("Can't edit multiple watches on varying memory domains"); - } - } - var we = new WatchEditor { InitialLocation = this.ChildPointToScreen(WatchListView),