diff --git a/Diz.Core.Interfaces/ModelInterfaces.cs b/Diz.Core.Interfaces/ModelInterfaces.cs index 9558d7d3..4bcd8ec2 100644 --- a/Diz.Core.Interfaces/ModelInterfaces.cs +++ b/Diz.Core.Interfaces/ModelInterfaces.cs @@ -188,7 +188,7 @@ public interface IData : // TODO: temp hack for serialization, do this better somehow. Dictionary LabelsSerialization { get; } - public ObservableDictionary Comments { get; } + public SortedDictionary Comments { get; } } public static class DataExtensions diff --git a/Diz.Core/model/LabelProvider.cs b/Diz.Core/model/LabelProvider.cs index fc924b6e..31e3ff04 100644 --- a/Diz.Core/model/LabelProvider.cs +++ b/Diz.Core/model/LabelProvider.cs @@ -252,7 +252,7 @@ public void AddLabel(int snesAddress, IAnnotationLabel labelToAdd, bool overwrit public class LabelsCollection : LabelProviderBase, ILabelService, IEquatable { // ReSharper disable once MemberCanBePrivate.Global - public Dictionary Labels { get; } = new(); + public SortedDictionary Labels { get; } = new(); [XmlIgnore] IEnumerable> IReadOnlyLabelProvider.Labels => Labels; diff --git a/Diz.Core/model/snes/Data.cs b/Diz.Core/model/snes/Data.cs index ceec9ab7..81ebfa65 100644 --- a/Diz.Core/model/snes/Data.cs +++ b/Diz.Core/model/snes/Data.cs @@ -5,7 +5,6 @@ using System.Xml.Serialization; using Diz.Core.Interfaces; using Diz.Core.util; -using IX.Observable; namespace Diz.Core.model.snes; @@ -15,7 +14,7 @@ public class Data : IData public IDataStoreProvider Apis { get; } = new DataStoreProvider(); public IDataStoreProvider Tags { get; } = new DataStoreProvider(); - private ObservableDictionary comments; + private SortedDictionary comments; private RomBytes romBytes; // NOTE: snes specific stuff (rom map mode/speed) should eventually be removed from here. @@ -44,7 +43,7 @@ public RomSpeed RomSpeed } // next 2 dictionaries store in SNES address format (since memory labels can't be represented as a PC address) - public ObservableDictionary Comments + public SortedDictionary Comments { get => comments; set => this.SetField(PropertyChanged, ref comments, value); @@ -68,11 +67,11 @@ public RomBytes RomBytes IRomBytes IRomBytesProvider.RomBytes => romBytes; [XmlIgnore] - public bool RomBytesLoaded { get; set; } = false; + public bool RomBytesLoaded { get; set; } public Data() { - comments = new ObservableDictionary(); + comments = new SortedDictionary(); Labels = new LabelsServiceWithTemp(this); romBytes = new RomBytes(); } diff --git a/Diz.Cpu.65816/src/SampleRomData.cs b/Diz.Cpu.65816/src/SampleRomData.cs index 0292640a..352d4ba9 100644 --- a/Diz.Cpu.65816/src/SampleRomData.cs +++ b/Diz.Cpu.65816/src/SampleRomData.cs @@ -215,7 +215,7 @@ public Data Create() new() { Rom = 0x34, TypeFlag = FlagType.Data8Bit, DataBank = 0x80, DirectPage = 0x2100 }, new() { Rom = 0x6D, TypeFlag = FlagType.Data8Bit, DataBank = 0x80, DirectPage = 0x2100 }, }; - data.Comments = new ObservableDictionary + data.Comments = new SortedDictionary { { 0x808000 + 0x03, "this sets FastROM" }, { 0x808000 + 0x0F, "direct page = $2100" },