@henols/c64-re-tools 2.3.0-rc.1 → 2.3.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +2 -3
  2. package/skills/c64-assembler/SKILL.md +4 -6
  3. package/skills/c64-basic/SKILL.md +2 -4
  4. package/skills/c64-development/SKILL.md +3 -3
  5. package/skills/c64-disk/SKILL.md +3 -7
  6. package/skills/c64-docs/SKILL.md +2 -4
  7. package/skills/c64-export/SKILL.md +4 -4
  8. package/skills/c64-knowledge/SKILL.md +3 -3
  9. package/skills/c64-memory-map/SKILL.md +1 -3
  10. package/skills/c64-packer/SKILL.md +9 -11
  11. package/skills/c64-packer/scripts/packer.ts +2 -20
  12. package/skills/c64-provenance/SKILL.md +18 -7
  13. package/skills/c64-provenance/scripts/lib/compare.ts +144 -16
  14. package/skills/c64-provenance/scripts/provenance.ts +37 -8
  15. package/skills/c64-reverse-engineering/SKILL.md +3 -3
  16. package/skills/c64-source/SKILL.md +37 -18
  17. package/skills/c64-source/scripts/lib/loader.ts +281 -43
  18. package/skills/c64-source/scripts/source.ts +37 -9
  19. package/skills/c64-static-analysis/SKILL.md +4 -4
  20. package/skills/c64-testing/SKILL.md +13 -13
  21. package/skills/c64-testing/references/recording-format.md +1 -1
  22. package/skills/c64-testing/references/scenario-format.md +3 -3
  23. package/skills/c64-testing/scripts/lib/play.ts +4 -4
  24. package/skills/c64-testing/scripts/testing.ts +1 -1
  25. package/skills/c64-unpacker/SKILL.md +12 -12
  26. package/skills/c64-unpacker/scripts/lib/loads.ts +17 -4
  27. package/skills/c64-unpacker/scripts/unpacker.ts +15 -3
  28. package/skills/emulator/SKILL.md +3 -3
  29. package/src/cli/cleanup.ts +30 -0
  30. package/src/cli/main.ts +5 -1
  31. package/src/compare.ts +18 -0
  32. package/src/host-client/coverage.ts +26 -0
  33. package/src/mcp/tools/machine.ts +2 -2
  34. package/README.md +0 -143
package/README.md DELETED
@@ -1,143 +0,0 @@
1
- # c64-re-tools
2
-
3
- <img src="assets/branding/c64-re-tools-transparent.svg" alt="C64 RE Tools" width="440">
4
-
5
-
6
- Let an AI agent work on Commodore 64 programs. The agent drives a real VICE
7
- emulator and runs ACME, DXA, Ghidra and Exomizer. Use it to build new C64 apps and games,
8
- and to reverse engineer old ones.
9
-
10
- It works with Claude Code, Codex, pi, opencode, Gemini, Copilot, Cursor and
11
- Windsurf.
12
-
13
- ## What it can do
14
-
15
- Ask for what you want in plain words. The agent picks the skill for each step.
16
-
17
- **Build new apps and games**
18
-
19
- - Assemble 6510 source with ACME, with errors by file and line, and symbols.
20
- - Pack and crunch a program with Exomizer into one PRG that unpacks itself, checked byte for byte before it is written.
21
- - Load and run the program in VICE. Set breakpoints and watchpoints, step, and read the CPU history and the call stack.
22
- - Read, write, search and compare memory, and disassemble it.
23
- - Show the VIC-II, sprite, SID and CIA state, and capture the screen.
24
- - Type on the keyboard and move the joystick.
25
- - Count cycles, profile the code, and wait for a raster line.
26
- - Run many steps in one go and keep screens, snapshots and coverage as files.
27
- - Tell what any address or register value means on the C64.
28
- - Add features and fixes to a program. Each change has a switch, so you can build the program with it or without it.
29
- - Test a program with scenarios: steps with expected values that give PASS or FAIL.
30
-
31
- **Reverse engineer existing programs**
32
-
33
- - Read D64, D71, D81, G64, T64 and CRT images, list BASIC and find the SYS address.
34
- - Find packers and capture the unpacked program from the emulator.
35
- - Analyse the code with DXA and Ghidra. The toolkit brings its own NMOS 6510 language for Ghidra, with all 256 opcodes.
36
- - Keep names, regions and comments as text in the project, ready for git.
37
- - Compare releases, and find routines that several programs share.
38
- - Generate ACME source that rebuilds the program byte for byte, and its documentation.
39
- - Test that a rebuild behaves as the original: PASS, FAIL or INCONCLUSIVE.
40
- - Export a rebuild as the start of a new program: one value for each switch, unused code removed, as a zip file.
41
-
42
- ## How it works
43
-
44
- VICE and the Host Runtime run on your computer, where VICE can open a window.
45
- The agent runs in a dev container in your project. It reaches VICE through an
46
- MCP server, and it runs ACME, DXA, Ghidra, Exomizer and c64run through its skills.
47
-
48
- ## Install
49
-
50
- ### Host
51
-
52
- You need Node.js 24 or newer and VICE 3.9 or later (`x64sc`, `c1541`, `petcat`)
53
- with its ROM files. Use the latest VICE release.
54
-
55
- Start the Host Runtime, and leave it running:
56
-
57
- ```
58
- npx -y --package=@henols/c64-re-tools@latest c64-re-tools-host
59
- ```
60
-
61
- ### Dev container
62
-
63
- You need Docker or Podman. Copy the example into your project:
64
-
65
- ```
66
- mkdir -p .devcontainer
67
- curl -fsSL -o .devcontainer/devcontainer.json https://raw.githubusercontent.com/henols/c64-re-tools/main/devcontainer/example/devcontainer.json
68
- ```
69
-
70
- Its comments tell what to change: the harness, the release channel, the image
71
- and the address of the Host Runtime. If the project already has a
72
- `devcontainer.json`, copy the c64-re-tools Feature and `runArgs` into it.
73
-
74
- Open the project in the container, for example with "Reopen in Container" in
75
- VS Code, or with `npx -y @devcontainers/cli up --workspace-folder .`. The
76
- Feature gives the container ACME, dxa, Exomizer, Java 21, Ghidra and c64run. At each
77
- start it installs the newest toolkit of its channel into the project, with the
78
- tools of that version. It reads its options only when the container is built:
79
- rebuild after a change.
80
-
81
- Check what works, in the container:
82
-
83
- ```
84
- npx -y @henols/c64-re-tools@latest status
85
- ```
86
-
87
- ## Use it
88
-
89
- Start the agent in the project, for example `claude`, and ask for what you want:
90
-
91
- ```
92
- Write a game in ACME where a sprite moves with the joystick and the border
93
- flashes when it hits the edge. Build it, run it, and show me the screen.
94
- ```
95
- ```
96
- The music stops when the title screen starts. Find out why.
97
- ```
98
- ```
99
- Reverse engineer original/game.d64. Find how it starts, unpack it if it is
100
- packed, and name the main routines.
101
- ```
102
- ```
103
- Find the routine that draws the score, and explain how it works.
104
- ```
105
-
106
- The agent keeps what it learns about a program as text in
107
- `.c64-re-tools/knowledge/`. Commit that folder with the project. If a command
108
- reports conflicts after a `git pull`, run `knowledge.ts merge`.
109
-
110
- Several programs in one repository: open the repository root in the dev
111
- container and give each program its own folder. A folder with `.c64-re-tools/` is a project.
112
-
113
- ## Settings
114
-
115
- Set the host variables where the Host Runtime starts, and the others in
116
- `containerEnv` of the `devcontainer.json`.
117
-
118
- | Variable | Meaning |
119
- | --- | --- |
120
- | `C64RT_VICE`, `C64RT_C1541`, `C64RT_PETCAT` | Full path of the VICE tool, when it is not on `PATH` (host). |
121
- | `C64RT_HOST` | `host:port` of the Host Runtime, when it is not on 127.0.0.1, `host.docker.internal` or `host.containers.internal` at port 6464. |
122
- | `C64RT_VIDEO` | `pal` (default) or `ntsc`. |
123
- | `C64RT_TRACE` | A directory for the trace of the MCP server and the skill scripts. See [Trace](#trace). |
124
-
125
- ## Trace
126
-
127
- Turn on the trace when a tool fails and its error does not tell why. Each
128
- program then writes what it does to a directory, as JSON lines. The Host
129
- Runtime also keeps a copy of the VICE log. The agent does not see the trace.
130
-
131
- On the host, `--log-dir` names the directory, and `--log-console` prints the
132
- same events:
133
-
134
- ```
135
- npx -y --package=@henols/c64-re-tools@latest c64-re-tools-host --log-dir $HOME/c64-trace --log-console
136
- ```
137
-
138
- For the MCP server and the skill scripts, set `C64RT_TRACE` to an absolute
139
- directory in `containerEnv` of the `devcontainer.json`.
140
-
141
- ## License
142
-
143
- MIT. See [LICENSE](LICENSE).