mirror of
https://github.com/fadden/6502bench.git
synced 2025-07-26 05:24:41 +00:00
Add selectable auto-label styles
SourceGen creates "auto" labels when it finds a reference to an address that doesn't have a label associated with it. The label for address $1234 would be "L1234". This change allows the project to specify alternative label naming conventions, annotating them with information from the cross-reference data. For example, a subroutine entry point (i.e. the target of a JSR) would be "S_1234". (The underscore was added to avoid confusion when an annotation letter is the same as a hex digit.) Also, tweaked the way the preferred clipboard line format is stored in the settings file (was an integer, now an enumeration string).
This commit is contained in:
@@ -185,6 +185,7 @@ namespace SourceGen {
|
||||
public string CpuName { get; set; }
|
||||
public bool IncludeUndocumentedInstr { get; set; }
|
||||
public int EntryFlags { get; set; }
|
||||
public string AutoLabelStyle { get; set; }
|
||||
public SerAnalysisParameters AnalysisParams { get; set; }
|
||||
public List<string> PlatformSymbolFileIdentifiers { get; set; }
|
||||
public List<string> ExtensionScriptFileIdentifiers { get; set; }
|
||||
@@ -195,6 +196,7 @@ namespace SourceGen {
|
||||
CpuName = Asm65.CpuDef.GetCpuNameFromType(props.CpuType);
|
||||
IncludeUndocumentedInstr = props.IncludeUndocumentedInstr;
|
||||
EntryFlags = props.EntryFlags.AsInt;
|
||||
AutoLabelStyle = props.AutoLabelStyle.ToString();
|
||||
AnalysisParams = new SerAnalysisParameters(props.AnalysisParams);
|
||||
|
||||
// External file identifiers require no conversion.
|
||||
@@ -461,6 +463,12 @@ namespace SourceGen {
|
||||
proj.ProjectProps.CpuType = Asm65.CpuDef.GetCpuTypeFromName(spf.ProjectProps.CpuName);
|
||||
proj.ProjectProps.IncludeUndocumentedInstr = spf.ProjectProps.IncludeUndocumentedInstr;
|
||||
proj.ProjectProps.EntryFlags = Asm65.StatusFlags.FromInt(spf.ProjectProps.EntryFlags);
|
||||
if (Enum.TryParse<AutoLabel.Style>(spf.ProjectProps.AutoLabelStyle,
|
||||
out AutoLabel.Style als)) {
|
||||
proj.ProjectProps.AutoLabelStyle = als;
|
||||
} else {
|
||||
// unknown value, leave as default
|
||||
}
|
||||
proj.ProjectProps.AnalysisParams = new ProjectProperties.AnalysisParameters();
|
||||
proj.ProjectProps.AnalysisParams.AnalyzeUncategorizedData =
|
||||
spf.ProjectProps.AnalysisParams.AnalyzeUncategorizedData;
|
||||
|
Reference in New Issue
Block a user