Skip to content

Commit

Permalink
release notes, version increment, fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
mike42 committed Jul 1, 2022
1 parent a765f83 commit 51a521e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/ca65/AsmMnemonicCompletionContributor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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<String> 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));
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/ca65/helpers/MnemonicHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -130,18 +130,18 @@ public class MnemonicHelper {
new MnemonicInfo("xce", "Exchange Carry and Emulation Bits"),
};

public static Set<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/ca65/helpers/MnemonicInfo.java
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 51a521e

Please sign in to comment.