64kramsystem / 64kramsystem/ghidra-vice-connector

Illegal opcode support for 6510

未关闭
#15 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
priority: medium
主要语言
Python
星标
1
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。