From 51a521ed1302fcc1d3478b212987f02434efdd87 Mon Sep 17 00:00:00 2001 From: Michael Billington Date: Fri, 1 Jul 2022 20:42:50 +1000 Subject: [PATCH] release notes, version increment, fix some typos --- README.md | 1 + build.gradle | 8 +++++--- .../org/ca65/AsmMnemonicCompletionContributor.java | 8 ++++---- src/main/java/org/ca65/helpers/MnemonicHelper.java | 14 +++++++------- src/main/java/org/ca65/helpers/MnemonicInfo.java | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 47c9da6..1a68782 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ This is plugin for JetBrains IDE's, which provides basic support for 6502 assemb - Code folding for scopes, procedures and macro definitions - Completion suggestions for mnemonics and labels - Warnings for undefined and unused symbols +- Code formatting ## Installation diff --git a/build.gradle b/build.gradle index 561f9d7..7802452 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'org.jetbrains.grammarkit' import org.jetbrains.grammarkit.tasks.* group 'org.ca65' -version '1.6' +version '1.7' sourceCompatibility = 11 repositories { @@ -38,9 +38,11 @@ runPluginVerifier { } patchPluginXml { - changeNotes = """This change adds warnings for unresolved references within the same assembly file, and also highlights unused declarations. The result is not correct for projects which include symbols from other files (as opposed to importing them), so this feature may be disabled per-project via an intention action. + changeNotes = """This version adds a code formatter for 6502 assembly files. - A new weak warning has been added to suggest padding hex and binary numbers to a whole byte, since eg. 7 digit binary numbers often indicate a problem.""" +This release also corrects an issue where square brackets, as used in some 65C816 long addressing modes, were being treated as a syntax error. + +Line markers for branch instructions have been improved. 65C186 branch instructions are now recognised, and the plugin can now identify branches to unnamed labels, which are indicated with a different icon. Lastly, this version corrects a bug which prevented these line markers from appearing.""" sinceBuild = '211.6693' } diff --git a/src/main/java/org/ca65/AsmMnemonicCompletionContributor.java b/src/main/java/org/ca65/AsmMnemonicCompletionContributor.java index 0b406f3..eb48554 100644 --- a/src/main/java/org/ca65/AsmMnemonicCompletionContributor.java +++ b/src/main/java/org/ca65/AsmMnemonicCompletionContributor.java @@ -14,7 +14,7 @@ import java.util.Set; import static com.intellij.patterns.PlatformPatterns.psiElement; -import static org.ca65.helpers.MnemonicHelper.allMnemnonics; +import static org.ca65.helpers.MnemonicHelper.allMnemonics; public class AsmMnemonicCompletionContributor extends CompletionContributor { public AsmMnemonicCompletionContributor() { @@ -30,12 +30,12 @@ public void addCompletions(@NotNull CompletionParameters parameters, Color mnemonicColor = AsmSyntaxHighlighter.MNEMONIC.getDefaultAttributes().getForegroundColor(); Cpu projectCpu = AsmConfiguration.getInstance(parameters.getPosition().getProject()).getCpu(); Set mnemonicsToShow = MnemonicHelper.getMnemonicsForCpu(projectCpu); - for(MnemonicInfo completionMnemonic : allMnemnonics) { - if(!mnemonicsToShow.contains(completionMnemonic.mnemnonic)) { + for(MnemonicInfo completionMnemonic : allMnemonics) { + if(!mnemonicsToShow.contains(completionMnemonic.mnemonic)) { // Skip mnemonics which aren't valid for this CPU. continue; } - resultSet.addElement(LookupElementBuilder.create(completionMnemonic.mnemnonic) + resultSet.addElement(LookupElementBuilder.create(completionMnemonic.mnemonic) .withItemTextForeground(mnemonicColor) .withTailText(" " + completionMnemonic.description)); } diff --git a/src/main/java/org/ca65/helpers/MnemonicHelper.java b/src/main/java/org/ca65/helpers/MnemonicHelper.java index 7a13377..4d5574e 100644 --- a/src/main/java/org/ca65/helpers/MnemonicHelper.java +++ b/src/main/java/org/ca65/helpers/MnemonicHelper.java @@ -3,7 +3,7 @@ import java.util.Set; public class MnemonicHelper { - public static MnemonicInfo[] allMnemnonics = new MnemonicInfo[] { + public static MnemonicInfo[] allMnemonics = new MnemonicInfo[] { new MnemonicInfo("adc", "Add Memory to Accumulator with Carry"), new MnemonicInfo("and", "\"AND\" Memory with Accumulator"), new MnemonicInfo("asl", "Shift One Bit Left, Memory or Accumulator"), @@ -130,18 +130,18 @@ public class MnemonicHelper { new MnemonicInfo("xce", "Exchange Carry and Emulation Bits"), }; - public static Set validMnemnonics65C816 = Set.of("adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "bra", "brk", "brl", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cop", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jml", "jmp", "jsl", "jsr", "lda", "ldx", "ldy", "lsr", "mvn", "mvp", "nop", "ora", "pea", "pei", "per", "pha", "phb", "phd", "phk", "php", "phx", "phy", "pla", "plb", "pld", "plp", "plx", "ply", "rep", "rol", "ror", "rti", "rtl", "rts", "sbc", "sep", "sec", "sed", "sei", "sta", "stp", "stx", "sty", "stz", "tax", "tay", "tcd", "tcs", "tdc", "trb", "tsb", "tsc", "tsx", "txa", "txs", "txy", "tya", "tyx", "wai", "wdm", "xba", "xce"); - public static Set validMnemnonics65C02 = Set.of("adc", "and", "asl", "bbr0", "bbr1", "bbr2", "bbr3", "bbr4", "bbr5", "bbr6", "bbr7", "bbs0", "bbs1", "bbs2", "bbs3", "bbs4", "bbs5", "bbs6", "bbs7", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "bra", "brk", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jmp", "jsr", "lda", "ldx", "ldy", "lsr", "nop", "ora", "pha", "php", "phx", "phy", "pla", "plp", "plx", "ply", "rmb0", "rmb1", "rmb2", "rmb3", "rmb4", "rmb5", "rmb6", "rmb7", "rol", "ror", "rti", "rts", "sbc", "sec", "sed", "sei", "smb0", "smb1", "smb2", "smb3", "smb4", "smb5", "smb6", "smb7", "sta", "stp", "stx", "sty", "stz", "tax", "tay", "trb", "tsb", "tsx", "txa", "txs", "tya", "wai"); - public static Set validMnemnonics6502 = Set.of("adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "brk", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jmp", "jsr", "lda", "ldx", "ldy", "lsr", "nop", "ora", "pha", "php", "pla", "plp", "ror", "rti", "rts", "sbc", "sec", "sed", "sei", "sta", "stx", "sty", "tax", "tay", "tsx", "txa", "txs", "tya"); + public static Set validMnemonics65C816 = Set.of("adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "bra", "brk", "brl", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cop", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jml", "jmp", "jsl", "jsr", "lda", "ldx", "ldy", "lsr", "mvn", "mvp", "nop", "ora", "pea", "pei", "per", "pha", "phb", "phd", "phk", "php", "phx", "phy", "pla", "plb", "pld", "plp", "plx", "ply", "rep", "rol", "ror", "rti", "rtl", "rts", "sbc", "sep", "sec", "sed", "sei", "sta", "stp", "stx", "sty", "stz", "tax", "tay", "tcd", "tcs", "tdc", "trb", "tsb", "tsc", "tsx", "txa", "txs", "txy", "tya", "tyx", "wai", "wdm", "xba", "xce"); + public static Set validMnemonics65C02 = Set.of("adc", "and", "asl", "bbr0", "bbr1", "bbr2", "bbr3", "bbr4", "bbr5", "bbr6", "bbr7", "bbs0", "bbs1", "bbs2", "bbs3", "bbs4", "bbs5", "bbs6", "bbs7", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "bra", "brk", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jmp", "jsr", "lda", "ldx", "ldy", "lsr", "nop", "ora", "pha", "php", "phx", "phy", "pla", "plp", "plx", "ply", "rmb0", "rmb1", "rmb2", "rmb3", "rmb4", "rmb5", "rmb6", "rmb7", "rol", "ror", "rti", "rts", "sbc", "sec", "sed", "sei", "smb0", "smb1", "smb2", "smb3", "smb4", "smb5", "smb6", "smb7", "sta", "stp", "stx", "sty", "stz", "tax", "tay", "trb", "tsb", "tsx", "txa", "txs", "tya", "wai"); + public static Set validMnemonics6502 = Set.of("adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi", "bne", "bpl", "brk", "bvc", "bvs", "clc", "cld", "cli", "clv", "cmp", "cpx", "cpy", "dec", "dex", "dey", "eor", "inc", "inx", "iny", "jmp", "jsr", "lda", "ldx", "ldy", "lsr", "nop", "ora", "pha", "php", "pla", "plp", "ror", "rti", "rts", "sbc", "sec", "sed", "sei", "sta", "stx", "sty", "tax", "tay", "tsx", "txa", "txs", "tya"); public static Set getMnemonicsForCpu(Cpu cpu) { switch (cpu) { case CPU_6502: - return validMnemnonics6502; + return validMnemonics6502; case CPU_65C02: - return validMnemnonics65C02; + return validMnemonics65C02; case CPU_65C816: - return validMnemnonics65C816; + return validMnemonics65C816; } throw new UnsupportedOperationException("Unknown CPU " + cpu); } diff --git a/src/main/java/org/ca65/helpers/MnemonicInfo.java b/src/main/java/org/ca65/helpers/MnemonicInfo.java index 028d63e..c193001 100644 --- a/src/main/java/org/ca65/helpers/MnemonicInfo.java +++ b/src/main/java/org/ca65/helpers/MnemonicInfo.java @@ -1,11 +1,11 @@ package org.ca65.helpers; public class MnemonicInfo { - public String mnemnonic; + public String mnemonic; public String description; public MnemonicInfo(String mnemonic, String description) { - this.mnemnonic = mnemonic; + this.mnemonic = mnemonic; this.description = description; } } \ No newline at end of file