public bool Initialize(ExecuteSetupData.MemoryContent content) { this.Words = new WordElement[content.WordCapacity]; if (this.Words.Length < content.WordCapacity) { MessageManager.ShowLine($"RAM: words capacity is too small for loading setup data.", enumMessageLevel.ProgressLog); return(false); } for (int i = 0; i < content.Words.Count; i++) { this.Words[i] = new WordElement() { Content = content.Words[i].InitialValue, DebugInfoCount = content.Words[i].DebugInfoCount }; this.Words[i].DebugInfos.Element0 = DebugInfoElement.ConvertFrom(content.Words[i].DebugInfos.Element0); this.Words[i].DebugInfos.Element1 = DebugInfoElement.ConvertFrom(content.Words[i].DebugInfos.Element1); this.Words[i].DebugInfos.Element2 = DebugInfoElement.ConvertFrom(content.Words[i].DebugInfos.Element2); this.Words[i].DebugInfos.Element3 = DebugInfoElement.ConvertFrom(content.Words[i].DebugInfos.Element3); } return(true); }
public DebugInfoElement this[int index] { get { switch (index) { case 0: return(Element0); case 1: return(Element1); case 2: return(Element2); case 3: return(Element3); } return(default(DebugInfoElement)); } set { switch (index) { case 0: Element0 = value; break; case 1: Element1 = value; break; case 2: Element2 = value; break; case 3: Element3 = value; break; } } }
public DebugInfoElement GetDebugInfo(int address, int wordDivideCount = 1, int wordByteIndex = 0) { bool adjusted = false; while (Words[address].DebugInfoCount < wordDivideCount) { wordDivideCount /= 2; if (wordByteIndex % 2 != 0) { adjusted = true; } wordByteIndex /= 2; } DebugInfoElement res = Words[address].DebugInfos[wordByteIndex]; if (adjusted) { res.Usage = WordElement.enumUsage.FollowHead; } return(res); }