Пример #1
0
 public string GetEffectiveAddressString(string format)
 {
     if (EffectiveAddress >= 0)
     {
         AddressInfo relAddress = new AddressInfo()
         {
             Address = EffectiveAddress, Type = _cpuType == CpuType.Spc ? SnesMemoryType.SpcMemory : SnesMemoryType.CpuMemory
         };
         CodeLabel label = LabelManager.GetLabel(relAddress);
         if (label != null)
         {
             if (label.Length > 1)
             {
                 int gap = DebugApi.GetAbsoluteAddress(relAddress).Address - label.GetAbsoluteAddress().Address;
                 if (gap > 0)
                 {
                     return("[" + label.Label + "+" + gap.ToString() + "]");
                 }
             }
             return("[" + label.Label + "]");
         }
         else
         {
             return("[$" + EffectiveAddress.ToString(format) + "]");
         }
     }
     else
     {
         return("");
     }
 }
Пример #2
0
        private void mnuEditInMemoryViewer_Click(object sender, EventArgs e)
        {
            if (lstWatch.SelectedItems.Count != 1)
            {
                return;
            }

            if (_selectedAddress >= 0)
            {
                DebugWindowManager.OpenMemoryViewer(new AddressInfo()
                {
                    Address = _selectedAddress, Type = _cpuType.ToMemoryType()
                });
            }
            else if (_selectedLabel != null)
            {
                DebugWindowManager.OpenMemoryViewer(_selectedLabel.GetAbsoluteAddress());
            }
        }