diff --git a/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj b/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj index 3ecb098c69..be77f4aead 100644 --- a/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj +++ b/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj @@ -59,10 +59,7 @@ - - - @@ -80,6 +77,7 @@ + diff --git a/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd b/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd index 54b73a0b86..f5deb7e503 100644 --- a/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd +++ b/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd @@ -1,12 +1,5 @@  - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Attributes\ConfigPersistAttribute.cs - - @@ -36,14 +29,13 @@ - - - - - + + + + @@ -53,17 +45,11 @@ - - ECAAAAAAAABACAAgAAEAABAAAAAEAAAAAAAAAACAQAA= - Interfaces\IToolForm.cs - + - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Interfaces\IToolFormAutoConfig.cs - + diff --git a/BizHawk.Client.Common/BizHawk.Client.Common.csproj b/BizHawk.Client.Common/BizHawk.Client.Common.csproj index 51de386cc8..9f25fdcc5b 100644 --- a/BizHawk.Client.Common/BizHawk.Client.Common.csproj +++ b/BizHawk.Client.Common/BizHawk.Client.Common.csproj @@ -105,6 +105,7 @@ + @@ -232,6 +233,8 @@ + + @@ -239,9 +242,15 @@ + + + + + + diff --git a/BizHawk.Client.ApiHawk/Attributes/ConfigPersistAttribute.cs b/BizHawk.Client.Common/config/ConfigPersistAttribute.cs similarity index 100% rename from BizHawk.Client.ApiHawk/Attributes/ConfigPersistAttribute.cs rename to BizHawk.Client.Common/config/ConfigPersistAttribute.cs diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 7e9118efe0..5d1d317eca 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -138,6 +138,10 @@ namespace BizHawk.Client.Common { get { + if (frame == 0) { + return new KeyValuePair(0, InitialState); + } + if (States.ContainsKey(frame)) { StateAccessed(frame); diff --git a/BizHawk.Client.ApiHawk/Interfaces/IToolForm.cs b/BizHawk.Client.Common/tools/Interfaces/IToolForm.cs similarity index 100% rename from BizHawk.Client.ApiHawk/Interfaces/IToolForm.cs rename to BizHawk.Client.Common/tools/Interfaces/IToolForm.cs diff --git a/BizHawk.Client.ApiHawk/Interfaces/IToolFormAutoConfig.cs b/BizHawk.Client.Common/tools/Interfaces/IToolFormAutoConfig.cs similarity index 100% rename from BizHawk.Client.ApiHawk/Interfaces/IToolFormAutoConfig.cs rename to BizHawk.Client.Common/tools/Interfaces/IToolFormAutoConfig.cs diff --git a/BizHawk.Client.Common/tools/Watch/Watch.cs b/BizHawk.Client.Common/tools/Watch/Watch.cs index 2b74007322..42bab1ba87 100644 --- a/BizHawk.Client.Common/tools/Watch/Watch.cs +++ b/BizHawk.Client.Common/tools/Watch/Watch.cs @@ -232,7 +232,18 @@ namespace BizHawk.Client.Common /// True if they are equals; otherwise, false public static bool operator ==(Watch a, Cheat b) { - return a.Equals(b); + if (object.ReferenceEquals(a, null) || object.ReferenceEquals(b, null)) + { + return false; + } + else if (object.ReferenceEquals(a, b)) + { + return true; + } + else + { + return a.Equals(b); + } } /// diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchAddressComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchAddressComparer.cs index e17f4b4c30..eb30ad8e7d 100644 --- a/BizHawk.Client.Common/tools/Watch/WatchList/WatchAddressComparer.cs +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchAddressComparer.cs @@ -12,83 +12,40 @@ namespace BizHawk.Client.Common /// Netsed private class that define how to compare two /// based on their address /// - private struct WatchAddressComparer - : IEqualityComparer, + private sealed class WatchAddressComparer + : WatchEqualityComparer, IComparer { /// - /// Compare two between them - /// and determine wich one comes first. + /// Compares two between them + /// and determines wich one comes first. /// If they are equals, comapraison will done one the domain and next on size /// /// First - /// True if are equal; otherwise, false - /// + /// Second + /// 0 for equality, 1 if x comes first; -1 if y comes first public int Compare(Watch x, Watch y) - { - if (Equals(x, y)) { - return 0; - } - else if (x.Address.Equals(y.Address)) - { - if (x.Domain.Name.Equals(y.Domain.Name)) + if (Equals(x, y)) { - return x.Size.CompareTo(y.Size); + return 0; + } + else if (x.Address.Equals(y.Address)) + { + if (x.Domain.Name.Equals(y.Domain.Name)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Domain.Name.CompareTo(y.Domain.Name); + } } else { - return x.Domain.Name.CompareTo(y.Domain.Name); + return x.Address.CompareTo(y.Address); } } - else - { - return x.Address.CompareTo(y.Address); - } - } - - /// - /// Determine if two are equals - /// - /// First - /// Second - /// True if are equal; otherwise, false - public bool Equals(Watch x, Watch y) - { - if (object.ReferenceEquals(x, null)) - { - if (object.ReferenceEquals(y, null)) - { - return true; - } - else - { - return false; - } - } - else if (object.ReferenceEquals(y, null)) - { - return false; - } - else if (object.ReferenceEquals(x, y)) - { - return true; - } - else - { - return x.Address.Equals(y.Address); - } - } - - /// - /// Get the hash value of specified - /// - /// Watch to get hash - /// int that can serves as a unique representation of current Watch - public int GetHashCode(Watch obj) - { - return obj.GetHashCode(); } } } -} diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchChangeCountComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchChangeCountComparer.cs new file mode 100644 index 0000000000..ceb96266d4 --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchChangeCountComparer.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + /// + /// Netsed private class that define how to compare two + /// based on the number of changes + /// + private sealed class WatchChangeCountComparer + :WatchEqualityComparer + ,IComparer + { + /// + /// Compares two between them + /// and determines wich one comes first. + /// If they are equals, comapraison will done one the address and next on size + /// + /// First + /// Second + /// 0 for equality, 1 if x comes first; -1 if y comes first + public int Compare(Watch x, Watch y) + { + if (Equals(x, y)) + { + return 0; + } + else if (x.ChangeCount.Equals(y.ChangeCount)) + { + if (x.Address.Equals(y.Address)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Address.CompareTo(y.Address); + } + } + else + { + return x.ChangeCount.CompareTo(y.ChangeCount); + } + } + } + } +} diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchDomainComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchDomainComparer.cs index 39e3778a46..4293797f48 100644 --- a/BizHawk.Client.Common/tools/Watch/WatchList/WatchDomainComparer.cs +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchDomainComparer.cs @@ -12,25 +12,25 @@ namespace BizHawk.Client.Common /// Netsed private class that define how to compare two /// based on their domain /// - private struct WatchDomainComparer - : IEqualityComparer, + private sealed class WatchDomainComparer + : WatchEqualityComparer, IComparer { /// - /// Compare two between them - /// and determine wich one comes first. + /// Compares two between them + /// and determines wich one comes first. /// If they are equals, comapraison will done one the address and next on size /// /// First - /// True if are equal; otherwise, false - /// + ///Second + /// 0 for equality, 1 if x comes first; -1 if y comes first public int Compare(Watch x, Watch y) { - if(Equals(x, y)) + if (Equals(x, y)) { return 0; } - else if(x.Domain.Name.Equals(y.Domain.Name)) + else if (x.Domain.Name.Equals(y.Domain.Name)) { if (x.Address.Equals(y.Address)) { @@ -46,49 +46,6 @@ namespace BizHawk.Client.Common return x.Domain.Name.CompareTo(y.Domain.Name); } } - - /// - /// Determine if two are equals - /// - /// First - /// Second - /// True if are equal; otherwise, false - public bool Equals(Watch x, Watch y) - { - if(object.ReferenceEquals(x, null)) - { - if(object.ReferenceEquals(y, null)) - { - return true; - } - else - { - return false; - } - } - else if(object.ReferenceEquals(y, null)) - { - return false; - } - else if(object.ReferenceEquals(x,y)) - { - return true; - } - else - { - return x.Domain.Name.Equals(y.Domain.Name); - } - } - - /// - /// Get the hash value of specified - /// - /// Watch to get hash - /// int that can serves as a unique representation of current Watch - public int GetHashCode(Watch obj) - { - return obj.GetHashCode(); - } } } } diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchEqualityComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchEqualityComparer.cs new file mode 100644 index 0000000000..a7445904c3 --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchEqualityComparer.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + private class WatchEqualityComparer + : IEqualityComparer + { + /// + /// Determines if two are equals + /// + /// First + /// Second + /// True if are equal; otherwise, false + public bool Equals(Watch x, Watch y) + { + if (ReferenceEquals(x, null)) + { + if (ReferenceEquals(y, null)) + { + return true; + } + else + { + return false; + } + } + else if (ReferenceEquals(y, null)) + { + return false; + } + else if (ReferenceEquals(x, y)) + { + return true; + } + else + { + return false; + } + } + + /// + /// Gets the hash value of specified + /// + /// Watch to get hash + /// int that can serves as a unique representation of current Watch + public int GetHashCode(Watch obj) + { + return obj.GetHashCode(); + } + } + } +} diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index cb96859d9e..f3470cb9c7 100644 --- a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -33,6 +33,11 @@ namespace BizHawk.Client.Common private static readonly WatchDomainComparer domainComparer = new WatchDomainComparer(); private static readonly WatchAddressComparer addressComparer = new WatchAddressComparer(); + private static readonly WatchValueComparer valueComparer = new WatchValueComparer(); + private static readonly WatchPreviousValueComparer previousValueComparer = new WatchPreviousValueComparer(); + private static readonly WatchValueDifferenceComparer valueDifferenceComparer = new WatchValueDifferenceComparer(); + private static readonly WatchChangeCountComparer changeCountComparer = new WatchChangeCountComparer(); + private static readonly WatchNoteComparer noteComparer = new WatchNoteComparer(); private static IMemoryDomains _memoryDomains; @@ -256,92 +261,58 @@ namespace BizHawk.Client.Common } break; + case VALUE: if (reverse) { - _watchList = _watchList - .OrderByDescending(x => x.Value) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ThenBy(x => x.BigEndian) - .ToList(); + _watchList.Sort(valueComparer); + _watchList.Reverse(); } else { - _watchList = _watchList - .OrderBy(x => x.Value) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ThenBy(x => x.BigEndian) - .ToList(); + _watchList.Sort(valueComparer); } break; - case PREV: // Note: these only work if all entries are detailed objects! + + case PREV: if (reverse) { - _watchList = _watchList - .OrderByDescending(x => x.PreviousStr) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(previousValueComparer); + _watchList.Reverse(); } else { - _watchList = _watchList - .OrderBy(x => x.PreviousStr) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(previousValueComparer); } break; + case DIFF: if (reverse) { - _watchList = _watchList - .OrderByDescending(x => x.Diff) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(valueDifferenceComparer); + _watchList.Reverse(); } else { - _watchList = _watchList - .OrderBy(x => x.Diff) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(valueDifferenceComparer); } - break; + case CHANGES: if (reverse) { - _watchList = _watchList - .OrderByDescending(x => x.ChangeCount) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(changeCountComparer); + _watchList.Reverse(); } else { - _watchList = _watchList - .OrderBy(x => x.ChangeCount) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(changeCountComparer); } break; + case DOMAIN: if (reverse) { @@ -354,24 +325,16 @@ namespace BizHawk.Client.Common } break; + case NOTES: if (reverse) { - _watchList = _watchList - .OrderByDescending(x => x.Notes) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(noteComparer); + _watchList.Reverse(); } else { - _watchList = _watchList - .OrderBy(x => x.Notes) - .ThenBy(x => x.Address) - .ThenBy(x => x.Size) - .ThenBy(x => x.Type) - .ToList(); + _watchList.Sort(noteComparer); } break; @@ -521,7 +484,14 @@ namespace BizHawk.Client.Common }); } - [Obsolete("Use count property instead")] + [Obsolete("Use domain from individual watch instead")] + public MemoryDomain Domain + { + get { return _domain; } + set { _domain = value; } + } + + [Obsolete("Use count property instead", true)] public int ItemCount { get @@ -530,13 +500,6 @@ namespace BizHawk.Client.Common } } - [Obsolete("Use domain from individual watch instead")] - public MemoryDomain Domain - { - get { return _domain; } - set { _domain = value; } - } - #region File handling logic - probably needs to be its own class public bool Load(string path, bool append) diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchNoteComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchNoteComparer.cs new file mode 100644 index 0000000000..8c8caa5432 --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchNoteComparer.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + /// + /// Netsed private class that define how to compare two + /// based on their note + /// + private sealed class WatchNoteComparer + :WatchEqualityComparer, + IComparer + { + /// + /// Compares two between them + /// and determines wich one comes first. + /// If they are equals, comapraison will done one the address and next on size + /// + /// First + /// Second + /// 0 for equality, 1 if x comes first; -1 if y comes first + public int Compare(Watch x, Watch y) + { + if (Equals(x, y)) + { + return 0; + } + else if (string.Compare(x.Notes, y.Notes, true) == 0) + { + if (x.Address.Equals(y.Address)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Address.CompareTo(y.Address); + } + } + else + { + return string.Compare(x.Notes, y.Notes, true); + } + } + } + } +} diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchPreviousValueComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchPreviousValueComparer.cs new file mode 100644 index 0000000000..17045b3753 --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchPreviousValueComparer.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + /// + /// Netsed private class that define how to compare two + /// based on their previous value + /// + private sealed class WatchPreviousValueComparer + : WatchEqualityComparer, + IComparer + { + /// + /// Compares two between them + /// and determines wich one comes first. + /// If they are equals, comapraison will done one the address and next on size + /// + /// First + /// Second + /// 0 for equality, 1 if x comes first; -1 if y comes first + public int Compare(Watch x, Watch y) + { + if (Equals(x, y)) + { + return 0; + } + else if (x.Previous.Equals(y.Previous)) + { + if (x.Address.Equals(y.Address)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Address.CompareTo(y.Address); + } + } + else + { + return x.Previous.CompareTo(y.Previous); + } + } + } + } +} diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueComparer.cs new file mode 100644 index 0000000000..c0ec61d2d9 --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueComparer.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + /// + /// Netsed private class that define how to compare two + /// based on their values + /// + private sealed class WatchValueComparer + : WatchEqualityComparer, + IComparer + { + /// + /// Compares two between them + /// and determines wich one comes first. + /// If they are equals, comapraison will done one the address and next on size + /// + /// First + ///Second + /// 0 for equality, 1 if x comes first; -1 if y comes first + public int Compare(Watch x, Watch y) + { + int xValue; + int yValue; + + if (x.Type == DisplayType.Signed) + { + int.TryParse(x.ValueString, out xValue); + } + else + { + xValue = x.Value; + } + + if (y.Type == DisplayType.Signed) + { + int.TryParse(y.ValueString, out yValue); + } + else + { + yValue = y.Value; + } + + if (Equals(x, y)) + { + return 0; + } + else if (xValue.Equals(yValue)) + { + if (x.Address.Equals(y.Address)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Address.CompareTo(y.Address); + } + } + else + { + return xValue.CompareTo(yValue); + } + } + } + } +} \ No newline at end of file diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueDifferenceComparer.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueDifferenceComparer.cs new file mode 100644 index 0000000000..662b7886fc --- /dev/null +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchValueDifferenceComparer.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + /// + /// This class hold a collection + /// Different memory domain can be mixed + /// + public sealed partial class WatchList + { + /// + /// Netsed private class that define how to compare two + /// based on the diffence between current and previous value + /// + private sealed class WatchValueDifferenceComparer + : WatchEqualityComparer + , IComparer + { + + /// + /// Compares two between them + /// and determines wich one comes first. + /// If they are equals, comapraison will done one the address and next on size + /// + /// First + /// Second + /// 0 for equality, 1 if x comes first; -1 if y comes first + public int Compare(Watch x, Watch y) + { + if (Equals(x, y)) + { + return 0; + } + else if (x.Diff.Equals(y.Diff)) + { + if (x.Address.Equals(y.Address)) + { + return x.Size.CompareTo(y.Size); + } + else + { + return x.Address.CompareTo(y.Address); + } + } + else + { + return x.Diff.CompareTo(y.Diff); + } + } + } + } +} diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index c1f431efbc..de81acd338 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -1097,7 +1097,7 @@ namespace BizHawk.Client.EmuHawk index, (byte[])StatableEmulator.SaveStateBinary().Clone()); GlobalWin.MainForm.PauseEmulator(); - LoadFile(new FileInfo(newProject.Filename)); + LoadFile(new FileInfo(newProject.Filename), true); } } @@ -1112,7 +1112,7 @@ namespace BizHawk.Client.EmuHawk SaveRamEmulator.CloneSaveRam()); GlobalWin.MainForm.PauseEmulator(); - LoadFile(new FileInfo(newProject.Filename)); + LoadFile(new FileInfo(newProject.Filename), true); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 36644401a9..06c933f017 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -421,7 +421,7 @@ namespace BizHawk.Client.EmuHawk Settings.RecentTas.Add(Global.MovieSession.Movie.Filename); } - private bool LoadFile(FileInfo file) + private bool LoadFile(FileInfo file, bool startsFromSavestate = false) { if (!file.Exists) { @@ -429,7 +429,7 @@ namespace BizHawk.Client.EmuHawk return false; } - TasMovie newMovie = new TasMovie(false, _saveBackgroundWorker); + TasMovie newMovie = new TasMovie(startsFromSavestate, _saveBackgroundWorker); newMovie.TasStateManager.InvalidateCallback = GreenzoneInvalidated; newMovie.Filename = file.FullName; @@ -440,7 +440,10 @@ namespace BizHawk.Client.EmuHawk if (TasView.AllColumns.Count() == 0) SetUpColumns(); - GoToFrame(CurrentTasMovie.Session.CurrentFrame); + if (startsFromSavestate) + GoToFrame(0); + else + GoToFrame(CurrentTasMovie.Session.CurrentFrame); CurrentTasMovie.CurrentBranch = CurrentTasMovie.Session.CurrentBranch; // clear all selections diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 5c5e24b938..e489cc87bb 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -119,7 +119,7 @@ namespace BizHawk.Client.EmuHawk public void AddWatch(Watch watch) { _watches.Add(watch); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateValues(); UpdateWatchCount(); Changes(); @@ -176,7 +176,7 @@ namespace BizHawk.Client.EmuHawk else { Global.Config.RecentWatches.Add(path); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateWatchCount(); UpdateStatusBar(); _watches.Changes = false; @@ -197,7 +197,7 @@ namespace BizHawk.Client.EmuHawk if (result) { _watches.Load(file.FullName, append); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateWatchCount(); Global.Config.RecentWatches.Add(_watches.CurrentFileName); SetMemoryDomain(_watches.Domain.ToString()); @@ -386,7 +386,7 @@ namespace BizHawk.Client.EmuHawk private void FullyUpdateWatchList() { - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateWatchCount(); UpdateStatusBar(); UpdateValues(); @@ -417,7 +417,7 @@ namespace BizHawk.Client.EmuHawk if (duplicate) { _watches.AddRange(we.Watches); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; } else { @@ -499,7 +499,7 @@ namespace BizHawk.Client.EmuHawk if (result || suppressAsk) { _watches.Clear(); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateWatchCount(); UpdateStatusBar(); _sortReverse = false; @@ -598,7 +598,7 @@ namespace BizHawk.Client.EmuHawk private void WatchListView_QueryItemBkColor(int index, int column, ref Color color) { - if (index >= _watches.ItemCount) + if (index >= _watches.Count) { return; } @@ -624,7 +624,7 @@ namespace BizHawk.Client.EmuHawk { text = string.Empty; - if (index >= _watches.ItemCount || _watches[index].IsSeparator) + if (index >= _watches.Count || _watches[index].IsSeparator) { return; } @@ -764,7 +764,7 @@ namespace BizHawk.Client.EmuHawk _watches.Add(we.Watches[0]); Changes(); UpdateWatchCount(); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateValues(); } } @@ -784,7 +784,7 @@ namespace BizHawk.Client.EmuHawk _watches.Remove(item); } - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateValues(); UpdateWatchCount(); } @@ -838,7 +838,7 @@ namespace BizHawk.Client.EmuHawk _watches.Add(SeparatorWatch.Instance); } - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; Changes(); UpdateWatchCount(); } @@ -873,7 +873,7 @@ namespace BizHawk.Client.EmuHawk WatchListView.SelectItem(t, true); } - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; } private void MoveDownMenuItem_Click(object sender, EventArgs e) @@ -900,7 +900,7 @@ namespace BizHawk.Client.EmuHawk } Changes(); - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; } private void SelectAllMenuItem_Click(object sender, EventArgs e) @@ -1037,8 +1037,8 @@ namespace BizHawk.Client.EmuHawk { _watches.Load(filePaths[0], append: false); Global.Config.RecentWatches.Add(_watches.CurrentFileName); - WatchListView.ItemCount = _watches.ItemCount; - } + WatchListView.ItemCount = _watches.Count; + } } private void NewRamWatch_Enter(object sender, EventArgs e) @@ -1205,7 +1205,7 @@ namespace BizHawk.Client.EmuHawk _watches.Remove(item); } - WatchListView.ItemCount = _watches.ItemCount; + WatchListView.ItemCount = _watches.Count; UpdateValues(); UpdateWatchCount(); UpdateStatusBar(); diff --git a/BizHawk.sln b/BizHawk.sln index a8337f67e5..76fa113292 100644 --- a/BizHawk.sln +++ b/BizHawk.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version", "Version\Version.csproj", "{0CE8B337-08E3-4602-BF10-C4D4C75D2F13}" EndProject @@ -250,18 +250,18 @@ Global {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Win32.ActiveCfg = Debug|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Win32.Build.0 = Debug|Any CPU + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Win32.ActiveCfg = Debug|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Win32.Build.0 = Debug|x86 {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|x86.ActiveCfg = Debug|x86 {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|x86.Build.0 = Debug|x86 {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Any CPU.Build.0 = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Win32.ActiveCfg = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Win32.Build.0 = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|x86.ActiveCfg = Release|Any CPU - {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|x86.Build.0 = Release|Any CPU + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Mixed Platforms.Build.0 = Release|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Win32.ActiveCfg = Release|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Win32.Build.0 = Release|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|x86.ActiveCfg = Release|x86 + {8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE