public string LabelsAsFile(LabelFileFormat Format) { StringBuilder sb = new StringBuilder(); foreach (var token in Labels) { if (token.Value.Type == Types.SymbolInfo.Types.LABEL) { switch (Format) { case LabelFileFormat.VICE: sb.Append("add_label $"); sb.Append(token.Value.AddressOrValue.ToString("X4")); sb.Append(" ."); sb.AppendLine(token.Key.Replace('.', '_').Replace('-', '_').Replace("+", "plus")); break; case LabelFileFormat.C64DEBUGGER: sb.Append("al C:"); sb.Append(token.Value.AddressOrValue.ToString("X4")); sb.Append(" ."); sb.AppendLine(token.Key.Replace('.', '_').Replace('-', '_').Replace("+", "plus")); break; } } } return(sb.ToString()); }
public string LabelsAsFile(LabelFileFormat Format) { StringBuilder sb = new StringBuilder(); var sentLabels = new GR.Collections.Set <long>(); foreach (var token in Labels) { if (token.Value.Type == SymbolInfo.Types.LABEL) { switch (Format) { case LabelFileFormat.VICE: // VICE now bails on values outside 16bit if ((token.Value.AddressOrValue >= 0) && (token.Value.AddressOrValue <= 65535) && (!sentLabels.ContainsValue(token.Value.AddressOrValue))) { sentLabels.Add(token.Value.AddressOrValue); sb.Append("add_label $"); sb.Append(token.Value.AddressOrValue.ToString("X4")); sb.Append(" ."); sb.AppendLine(token.Key.Replace('.', '_').Replace('-', '_').Replace("+", "plus")); } break; case LabelFileFormat.C64DEBUGGER: sb.Append("al C:"); sb.Append(token.Value.AddressOrValue.ToString("X4")); sb.Append(" ."); sb.AppendLine(token.Key.Replace('.', '_').Replace('-', '_').Replace("+", "plus")); break; } } } return(sb.ToString()); }