64kramsystem / 64kramsystem/ghidra-vice-connector
Illegal opcode support for 6510
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Many C64 games use undocumented/illegal 6510 opcodes that Ghidra's stock \`6502:LE:16:default\` language does not recognise, causing misparse and broken disassembly chains.
Common illegals used in games:
| Opcode | Mnemonic | Effect |
|--------|----------|--------|
| \$A3/\$A7/\$AF/\$B3/\$B7/\$BF | LAX | LDA + LDX |
| \$83/\$87/\$8F/\$97 | SAX | A AND X → mem |
| \$C3/\$C7/\$CF/\$D3/\$D7/\$DB/\$DF | DCP | DEC + CMP |
| \$03/\$07/\$0F/\$13/\$17/\$1B/\$1F | SLO | ASL + ORA |
| \$23/\$27/\$2F/\$33/\$37/\$3B/\$3F | RLA | ROL + AND |
| \$EB | USBC/SBC | same as \$E9 SBC imm |
Options (increasing effort):
1. **SLEIGH patch** — extend the existing `6502.slaspec` with illegal opcode patterns. Requires rebuilding the language module.
2. **Custom language module** — fork the Ghidra 6502 processor module as `6510`, add illegals, publish as a separate extension.
3. **Pre-analysis script** — scan for known illegal bytes and convert to `??` data + comment before disassembly, limiting breakage to those sites.
Option 2 gives first-class support and is the correct long-term solution for a C64-focused tool.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.