@henols/c64-re-tools 2.2.1 → 2.3.0-rc.2
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.
- package/README.md +4 -3
- package/package.json +1 -1
- package/skills/c64-assembler/SKILL.md +4 -3
- package/skills/c64-assembler/scripts/assembler.ts +1 -1
- package/skills/c64-basic/SKILL.md +3 -3
- package/skills/c64-development/SKILL.md +9 -9
- package/skills/c64-disk/SKILL.md +2 -2
- package/skills/c64-docs/SKILL.md +2 -2
- package/skills/c64-knowledge/SKILL.md +1 -1
- package/skills/c64-memory-map/SKILL.md +2 -2
- package/skills/c64-packer/SKILL.md +109 -0
- package/skills/c64-packer/scripts/packer.ts +95 -0
- package/skills/c64-provenance/SKILL.md +18 -5
- package/skills/c64-provenance/scripts/lib/compare.ts +144 -16
- package/skills/c64-provenance/scripts/provenance.ts +37 -8
- package/skills/c64-reverse-engineering/SKILL.md +3 -3
- package/skills/c64-source/SKILL.md +23 -2
- package/skills/c64-source/scripts/lib/loader.ts +281 -43
- package/skills/c64-source/scripts/source.ts +37 -9
- package/skills/c64-static-analysis/SKILL.md +3 -3
- package/skills/c64-testing/SKILL.md +4 -4
- package/skills/c64-testing/scripts/lib/play.ts +4 -4
- package/skills/c64-testing/scripts/testing.ts +1 -1
- package/skills/c64-unpacker/SKILL.md +8 -8
- package/skills/c64-unpacker/scripts/lib/loads.ts +17 -4
- package/skills/c64-unpacker/scripts/unpacker.ts +15 -3
- package/skills/emulator/SKILL.md +137 -0
- package/src/cli/main.ts +1 -1
- package/{skills/c64-assembler/scripts/lib → src}/compare.ts +21 -3
- package/src/host-client/coverage.ts +26 -0
- package/src/mcp/output.ts +4 -4
- package/src/mcp/server.ts +7 -2
- package/src/mcp/tools/debug.ts +6 -3
- package/src/mcp/tools/execution.ts +1 -0
- package/src/mcp/tools/input.ts +1 -0
- package/src/mcp/tools/machine.ts +1 -1
- package/src/mcp/tools/media.ts +4 -2
- package/src/native/discover.ts +8 -0
- package/src/native/exomizer.ts +90 -0
- package/src/native/status.ts +3 -2
- package/tools/install-container.sh +2 -1
- package/tools/install-exomizer.sh +70 -0
- package/skills/c64-emulator/SKILL.md +0 -160
|
@@ -33,7 +33,7 @@ node <skill>/scripts/unpacker.ts loads original/game.d64 --steps .c64-re-tools/l
|
|
|
33
33
|
| `--until '$c000'` | `capture`: the address where the unpacked program starts. The capture stops there after the steps. To capture a later arrival at the address, add a `runUntil` step to an address after the first arrival. |
|
|
34
34
|
| `--out .c64-re-tools/local/capture` | `capture` and `loads`: the folder for the result, relative to the project folder. |
|
|
35
35
|
| `--range '$c000-$cfff'` | `capture` only: write this range as the one segment. Without it, the segments are the blocks that the stages wrote. The range must hold the `--until` address. |
|
|
36
|
-
| `--exclude '$a000-$a9ff'` | `capture`
|
|
36
|
+
| `--exclude '$a000-$a9ff'` | `capture` and `loads`: remove this range from the segments. You can give it more than once. `image.json` lists the ranges in `excluded`. For `capture`, the range must not hold the `--until` address. |
|
|
37
37
|
| `--timeout-frames 3000` | `capture` only: how many frames the program can run before the capture stops (default 3000). |
|
|
38
38
|
| `--frames 3000` | `trace` and `stages`: how many frames the program runs (default 3000). |
|
|
39
39
|
| `--entry '$c000'` | `trace`, `stages` and `capture`: start the program at this address. Without it, the script types RUN. A file that is not a BASIC program at `$0801` needs it. |
|
|
@@ -43,7 +43,7 @@ node <skill>/scripts/unpacker.ts loads original/game.d64 --steps .c64-re-tools/l
|
|
|
43
43
|
| `--min-block 64` | `loads` only: the smallest block of changed memory that becomes a segment (default 64). The result counts smaller changes as `smallChanges`. |
|
|
44
44
|
| `--min-stage 64` | `stages` and `capture`: the smallest block of written memory that starts a new stage when the CPU executes it (default 64). It does not change `wrote` or the segments. |
|
|
45
45
|
|
|
46
|
-
The capture reads RAM, also the RAM under the ROMs and the I/O area. The script refuses an option that the command does not use. It refuses a wrong `--range` or `--exclude` before the emulator starts.
|
|
46
|
+
The capture reads RAM, also the RAM under the ROMs and the I/O area. A segment can be in the RAM under the I/O area at `$d000`-`$dfff`. VICE shows each write there as an I/O write. Thus the script compares that RAM at the end of each stage or capture. The script refuses an option that the command does not use. It refuses a wrong `--range` or `--exclude` before the emulator starts.
|
|
47
47
|
|
|
48
48
|
A steps file is a JSON list of steps. Each step has the input of the MCP tool of the same action. An address in a step can be a name. The script refuses an unknown name before the emulator starts. The message gives the file and the step. For example, wait 50 frames and type a space:
|
|
49
49
|
|
|
@@ -99,12 +99,12 @@ The scripts refuse a step in the form of version 2.0, for example `{ "runUntil":
|
|
|
99
99
|
2. Run `trace`. It gives the evidence from the run. `writtenThenExecuted` lists the ranges that the program wrote and then executed. Read `packing`:
|
|
100
100
|
- `likely`: the program wrote code and then executed it. It unpacked, decrypted or moved code. `runningRange` is the written code that runs at the end of the trace. When the trace ends in ROM code, for example in an interrupt, it is the written code that runs next. Its `start` is code that runs after the unpacking. It is not always the entry point of the program. When no written code runs in 50 more frames, the result has no `runningRange` and no `suggestedUntil`.
|
|
101
101
|
- `unclear`: the program executed a small quantity of code that it wrote. This can be code that changes itself.
|
|
102
|
-
- `unlikely`: the program executed no code that it wrote. If the program waits for a key or a joystick, it can move code after that input. Then use the
|
|
102
|
+
- `unlikely`: the program executed no code that it wrote. If the program waits for a key or a joystick, it can move code after that input. Then use the emulator skill.
|
|
103
103
|
3. Find the address where the unpacked program starts:
|
|
104
104
|
- Run `stages`. The `entry` of the last stage is usually the start of the program. A routine that a stage writes and calls is part of that stage when it returns to the stage.
|
|
105
105
|
- Or use `runningRange.start` from `trace`, or `suggestedUntil`. The CPU gets to `suggestedUntil` after the unpacking.
|
|
106
|
-
- Or use the
|
|
107
|
-
- Disassemble the code at the address with the
|
|
106
|
+
- Or use the emulator skill: set a breakpoint after the unpack loop, or look at the last JMP of the unpacker.
|
|
107
|
+
- Disassemble the code at the address with the emulator skill. Make sure that it is the start of the program. The start of a program often sets the stack pointer, the interrupts and the vectors.
|
|
108
108
|
- A program can be relocated and not packed. Then a short copier moves the code and jumps to it. The moved code is the last stage. Make sure that the `entry` of the last stage is not code that the program writes later. An example is a routine that the program makes at run time. Disassemble the entry to make sure.
|
|
109
109
|
4. Run `capture` with that address and a directory in `--out`. Give the same `--steps` as before. The directory gets:
|
|
110
110
|
- `image.bin`: all 64 KiB of RAM at the entry.
|
|
@@ -134,7 +134,7 @@ A multi-load program loads more parts from the disk while it runs, for example o
|
|
|
134
134
|
]
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
2. Run `loads` with the steps file and a directory in `--out`. Add `--drive` when the program has its own drive code, for example a fast loader.
|
|
137
|
+
2. Run `loads` with the steps file and a directory in `--out`. Add `--drive` when the program has its own drive code, for example a fast loader. Add `--exclude` for each range of a loader, an intro or a loading picture that the program does not read. The script removes these ranges from the segments of each capture.
|
|
138
138
|
3. Each capture writes `<out>/<name>/` with `image.bin`, `image.json`, `entry_state.json` and a PRG for each segment. It removes the segment PRGs and the `drive8.prg` of an earlier capture that the new `image.json` does not list. A segment is a block of RAM from `$0400` that the program changed after the capture before. The first capture also has the program itself.
|
|
139
139
|
4. Put the part that you work on into the knowledge with `image <out>/<name>/image.json` of the c64-knowledge skill.
|
|
140
140
|
5. With `--drive`, `drive8.prg` is the drive RAM at `$0000`-`$07ff`. Put it into the knowledge with `image <out>/<name>/drive8.prg --space drive8`. Then analyze it with c64-static-analysis and `--space drive8`.
|
|
@@ -162,7 +162,7 @@ For `loads`: `captures`, with the name, the PC, the segments, `differsFromReset`
|
|
|
162
162
|
|
|
163
163
|
- `traced: false` or `followed: false`: the emulator did not load the program into memory in the time limit. The reason gives the load address. Make sure that the file is a PRG that the C64 can load.
|
|
164
164
|
- `traced: false` or `followed: false` with `stopReason`: the CPU stopped before the frames ran, for example at a JAM instruction. `pc` gives the address. Make sure that `--entry` is the start of the code that the file holds at that time, and that the steps are correct.
|
|
165
|
-
- `captured: false`: the program did not get to the address in the time limit. The reason tells where it stopped. Find a better address with the
|
|
165
|
+
- `captured: false`: the program did not get to the address in the time limit. The reason tells where it stopped. Find a better address with the emulator skill, or give more frames. If it stopped in a key wait, give `--steps` with a `type` step.
|
|
166
166
|
- A step did not reach its target: the reason names the step. Change the step or give it more frames.
|
|
167
167
|
- `loaded: false` with an empty `captures` and the reason `BASIC ran no program line`: the PRG has no BASIC start line. Use `capture` with `--entry`.
|
|
168
168
|
- `loaded: false` and no capture has a segment: the program did not load a part, or it did not start. `keyWait: true` on a capture tells that the C64 waited for a key at the READY prompt or at an INPUT statement. For a tape image, read `emulatorFlaw`. A known VICE flaw can stop a tape load. Tell the user to install the latest VICE.
|
|
@@ -174,4 +174,4 @@ For `loads`: `captures`, with the name, the PC, the segments, `differsFromReset`
|
|
|
174
174
|
## Handoffs
|
|
175
175
|
|
|
176
176
|
- Unpacked machine code → c64-static-analysis
|
|
177
|
-
- Find the start address at run time →
|
|
177
|
+
- Find the start address at run time → emulator
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
// image with its entry state, and with --drive the drive RAM as a PRG for
|
|
5
5
|
// knowledge space drive8. No tool guesses where a load ends: the steps decide.
|
|
6
6
|
|
|
7
|
-
import { COVERAGE, formatC64Address } from "#src/c64.ts";
|
|
7
|
+
import { type AddressRange, COVERAGE, formatC64Address } from "#src/c64.ts";
|
|
8
8
|
import { autostartLoaded, LOAD_LIMIT_FRAMES, RUN_LIMIT_FRAMES, typeRun } from "#src/host-client/autostart.ts";
|
|
9
|
-
import { readCoverage } from "#src/host-client/coverage.ts";
|
|
9
|
+
import { IO_RAM, markIoRamWrites, readCoverage } from "#src/host-client/coverage.ts";
|
|
10
10
|
import { ACTION_STEP_KINDS, checkActionStep, checkStepNames, isObject, runActionStep, VICE_STEP_KINDS, type ActionStep, type ActionStepKind } from "#src/host-client/steps.ts";
|
|
11
11
|
import { knowledgeAt } from "#src/knowledge/names.ts";
|
|
12
12
|
import { WireFailure } from "#src/host-client/tools.ts";
|
|
@@ -88,6 +88,17 @@ export function changedBlocks(before: Uint8Array, after: Uint8Array, map: Uint8A
|
|
|
88
88
|
return blocks.filter((block) => block.changed).map(({ start, end, bytes }) => ({ start, end, bytes }));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* The blocks of a capture: the changed blocks, also in the RAM under the I/O
|
|
93
|
+
* area, which the map gives as I/O writes. An excluded range holds no write,
|
|
94
|
+
* so it cuts the blocks and counts in no small change. Changes `map`.
|
|
95
|
+
*/
|
|
96
|
+
export function captureBlocks(before: Uint8Array, after: Uint8Array, map: Uint8Array, writesKnown: boolean, exclude: readonly AddressRange[]): Array<{ start: number; end: number; bytes: number }> {
|
|
97
|
+
markIoRamWrites(map, before.subarray(IO_RAM.start, IO_RAM.end + 1), after.subarray(IO_RAM.start, IO_RAM.end + 1));
|
|
98
|
+
for (const range of exclude) map.fill(0, range.start, range.end + 1);
|
|
99
|
+
return changedBlocks(before, after, map, 16, writesKnown);
|
|
100
|
+
}
|
|
101
|
+
|
|
91
102
|
const hex4 = (value: number) => value.toString(16).padStart(4, "0");
|
|
92
103
|
|
|
93
104
|
/**
|
|
@@ -96,7 +107,7 @@ const hex4 = (value: number) => value.toString(16).padStart(4, "0");
|
|
|
96
107
|
* `drive` the drive RAM as drive8.prg. Blocks below `minBlock` bytes are
|
|
97
108
|
* counted, not written: a game changes its variables all the time.
|
|
98
109
|
*/
|
|
99
|
-
export async function loads(program: string, options: { out: string; steps: LoadStep[]; drive: boolean; minBlock: number }): Promise<{ output: Record<string, unknown>; failed: boolean }> {
|
|
110
|
+
export async function loads(program: string, options: { out: string; steps: LoadStep[]; drive: boolean; minBlock: number; exclude: AddressRange[] }): Promise<{ output: Record<string, unknown>; failed: boolean }> {
|
|
100
111
|
const client = await ViceSessionClient.open({ videoStandard: "pal" });
|
|
101
112
|
try {
|
|
102
113
|
// A clean machine at the READY prompt shows what the program changed at each capture. The run goes on after a capture, so it is read first.
|
|
@@ -159,7 +170,7 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
159
170
|
for (let address = load; address < Math.min(0x10000, load + loadedProgram.length - 2); address++) map[address]! |= COVERAGE.ramWrite;
|
|
160
171
|
loadedProgram = undefined;
|
|
161
172
|
}
|
|
162
|
-
const blocks =
|
|
173
|
+
const blocks = captureBlocks(previous, memory, map, writesKnown, options.exclude);
|
|
163
174
|
const segments = blocks.filter((block) => block.end - block.start + 1 >= options.minBlock);
|
|
164
175
|
const small = blocks.filter((block) => !segments.includes(block)).reduce((sum, block) => sum + block.bytes, 0);
|
|
165
176
|
const state = await machineState(client);
|
|
@@ -186,6 +197,7 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
186
197
|
capture: step.capture,
|
|
187
198
|
entry: formatC64Address(registers.pc),
|
|
188
199
|
segments: segments.map((segment, at) => ({ ...showRange(segment), file: files[at] })),
|
|
200
|
+
...(options.exclude.length === 0 ? {} : { excluded: options.exclude.map(showRange) }),
|
|
189
201
|
vectors,
|
|
190
202
|
image: "image.bin",
|
|
191
203
|
...(drive === undefined ? {} : { drive }),
|
|
@@ -204,6 +216,7 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
204
216
|
pc: formatC64Address(registers.pc),
|
|
205
217
|
...(keyWait ? { keyWait: true } : {}),
|
|
206
218
|
segments: segments.map(showRange),
|
|
219
|
+
...(options.exclude.length === 0 ? {} : { excluded: options.exclude.map(showRange) }),
|
|
207
220
|
differsFromReset: entry.differsFromReset,
|
|
208
221
|
...(small === 0 ? {} : { smallChanges: small }),
|
|
209
222
|
...(drive === undefined ? {} : { drive: drive.file }),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { type AddressRange, COVERAGE, EXECUTE, formatC64Address, READ, WRITE } from "#src/c64.ts";
|
|
10
10
|
import { autostartLoaded, LOAD_LIMIT_FRAMES, RUN_LIMIT_FRAMES, typeRun } from "#src/host-client/autostart.ts";
|
|
11
|
-
import { readCoverage, writtenBlocks } from "#src/host-client/coverage.ts";
|
|
11
|
+
import { IO_RAM, markIoRamWrites, readCoverage, writtenBlocks } from "#src/host-client/coverage.ts";
|
|
12
12
|
import { readActionSteps, runActionStep, type ActionStep } from "#src/host-client/steps.ts";
|
|
13
13
|
import { WireFailure } from "#src/host-client/tools.ts";
|
|
14
14
|
import { readPrg } from "#src/host-client/image.ts";
|
|
@@ -226,6 +226,14 @@ async function follow(
|
|
|
226
226
|
const basic = basicStart(bytes);
|
|
227
227
|
const notStarted = await startLoaded(client, program, bytes, options.entry);
|
|
228
228
|
if (notStarted !== undefined) return { stages: [], frames: 0, reached: false, failed: notStarted };
|
|
229
|
+
// The map gives a write to the RAM under the I/O area as an I/O write: a compare of that RAM at each stage end finds them.
|
|
230
|
+
const readIoRam = () => readRam(client, IO_RAM.start, IO_RAM.end - IO_RAM.start + 1);
|
|
231
|
+
let ioRam = await readIoRam();
|
|
232
|
+
const markIoRam = async (map: Uint8Array) => {
|
|
233
|
+
const now = await readIoRam();
|
|
234
|
+
markIoRamWrites(map, ioRam, now);
|
|
235
|
+
ioRam = now;
|
|
236
|
+
};
|
|
229
237
|
// The frames of each step end where a scenario's do: the first step counts from RUN, a later one from where it starts.
|
|
230
238
|
let anchor: { line: number; cycle: number } | undefined = await rasterAt(client);
|
|
231
239
|
const framed = () => (anchor === undefined ? {} : { anchor });
|
|
@@ -244,6 +252,7 @@ async function follow(
|
|
|
244
252
|
let stage = { map: new Uint8Array(0x10000), own: new Set<number>(), called: [] as AddressRange[] };
|
|
245
253
|
const startStage = async (next: number, last: Uint8Array) => {
|
|
246
254
|
mergeMaps(stage.map, last);
|
|
255
|
+
await markIoRam(stage.map);
|
|
247
256
|
found.push({ entry, firstFrame, frames: total - firstFrame, wrote: stageWrote(stage.map), next });
|
|
248
257
|
entry = next;
|
|
249
258
|
firstFrame = total;
|
|
@@ -434,6 +443,7 @@ async function follow(
|
|
|
434
443
|
else reached = await trackTo(options.until, left);
|
|
435
444
|
await client.snapshot({ action: "remove", name: STAGE_SNAPSHOT }).catch(() => undefined);
|
|
436
445
|
mergeMaps(stage.map, await readCoverage(client));
|
|
446
|
+
await markIoRam(stage.map);
|
|
437
447
|
found.push({ entry, firstFrame, frames: total - firstFrame, wrote: stageWrote(stage.map) });
|
|
438
448
|
return { stages: found, frames: total, reached, ...(halted === undefined ? {} : { halted }) };
|
|
439
449
|
}
|
|
@@ -562,6 +572,7 @@ const PROGRAM = { name: "<program>", help: "a PRG file, relative to the project
|
|
|
562
572
|
const FRAMES: OptionSpec = { ...OPTIONS.frames, max: 30_000, default: 3000, help: "run the program for n frames (default 3000)" };
|
|
563
573
|
const ENTRY: OptionSpec = { ...OPTIONS.entry, help: "start the program here in place of RUN" };
|
|
564
574
|
const STEPS: OptionSpec = { ...OPTIONS.steps, help: "action steps (JSON) that run right after the program starts, for example to press a key in an intro or to get through a menu" };
|
|
575
|
+
const EXCLUDE: OptionSpec = { kind: "range", value: "<start>-<end>", multiple: true, help: "a range to leave out of the segments, for example bytes that a crack left and the program never reads" };
|
|
565
576
|
const MIN_STAGE: OptionSpec = { kind: "count", value: "<bytes>", min: 1, max: 0x10000, default: 64, help: "a stage starts when the CPU executes a block of at least this many bytes that the stage before wrote (default 64)" };
|
|
566
577
|
|
|
567
578
|
/** The result of a command: PASS, or FAIL with the reason. */
|
|
@@ -611,7 +622,7 @@ const COMMANDS: CommandSpec[] = [
|
|
|
611
622
|
until: { kind: "address", value: "<address>", required: true, help: "the unpacked entry point" },
|
|
612
623
|
out: { ...OPTIONS.out, output: "folder", value: "<dir>", required: true, help: "the folder for the capture, relative to the project folder" },
|
|
613
624
|
range: { ...OPTIONS.range, help: "one segment in place of the found ones" },
|
|
614
|
-
exclude:
|
|
625
|
+
exclude: EXCLUDE,
|
|
615
626
|
"timeout-frames": { ...OPTIONS["timeout-frames"], max: 30_000, default: 3000, help: "stop the wait for --until after n frames (default 3000)" },
|
|
616
627
|
entry: ENTRY,
|
|
617
628
|
steps: STEPS,
|
|
@@ -639,8 +650,9 @@ const COMMANDS: CommandSpec[] = [
|
|
|
639
650
|
out: { ...OPTIONS.out, output: "folder", value: "<dir>", required: true, help: "the folder for the captures, relative to the project folder" },
|
|
640
651
|
drive: { kind: "flag", help: "also write the 2 KiB drive RAM as drive8.prg, for knowledge space drive8" },
|
|
641
652
|
"min-block": { kind: "count", value: "<bytes>", min: 1, max: 0x10000, default: 64, help: "write a changed block of at least this many bytes (default 64)" },
|
|
653
|
+
exclude: EXCLUDE,
|
|
642
654
|
},
|
|
643
|
-
run: async (call) => outcome(await loads(call.subject(0), { out: call.string("out")!, steps: readLoadSteps(call.string("steps")!), drive: call.flag("drive"), minBlock: call.count("min-block")
|
|
655
|
+
run: async (call) => outcome(await loads(call.subject(0), { out: call.string("out")!, steps: readLoadSteps(call.string("steps")!), drive: call.flag("drive"), minBlock: call.count("min-block")!, exclude: call.ranges("exclude") })),
|
|
644
656
|
},
|
|
645
657
|
];
|
|
646
658
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: emulator
|
|
3
|
+
description: Use this skill to operate and debug the live emulator through the MCP tools of the c64-re-tools machine server. For the C64, the tool names start with c64_. It loads programs and disks, controls and steps the CPU, and sets breakpoints and watchpoints. It reads and writes memory and registers, gives keyboard and joystick input, advances frames and captures the screen. Do not use it for static analysis, project knowledge, assembly or disk inspection.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# emulator
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Operate and debug the one live machine that belongs to this MCP session. Get runtime evidence and runtime state from it.
|
|
11
|
+
|
|
12
|
+
This skill does not analyse code statically. It does not write project knowledge. It does not assemble source code.
|
|
13
|
+
|
|
14
|
+
The MCP server knows the machine and the emulator. Its instructions, its tool descriptions, its result fields and its error messages give the facts of the machine and the known flaws of the emulator. This skill tells how to use the tools for a task. If this skill and a tool description do not agree, obey the tool description.
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
- The machine action or the runtime question.
|
|
19
|
+
- The target address, state or condition, when the question needs one.
|
|
20
|
+
- The project path of the program or disk to load, when the question needs one.
|
|
21
|
+
|
|
22
|
+
A tool takes addresses, not names. The server instructions give the address format. Get the address of a name with `knowledge.ts at <name>` of the c64-knowledge skill.
|
|
23
|
+
|
|
24
|
+
## Tools / execution path
|
|
25
|
+
|
|
26
|
+
Use only the MCP tools. Each MCP session has its own machine. Nothing else can change that machine.
|
|
27
|
+
|
|
28
|
+
| Need | C64 tool |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Run state, warp mode, window, version of the MCP server | `c64_status` |
|
|
31
|
+
| Reset, power cycle | `c64_reset` |
|
|
32
|
+
| Fast emulation | `c64_warp` |
|
|
33
|
+
| Show the machine to the user in a window, hide it again | `c64_window` |
|
|
34
|
+
| Stop, start, step, step over, step out, exact frames | `c64_execution` |
|
|
35
|
+
| Run until an address, a memory value or a raster position | `c64_run_until` |
|
|
36
|
+
| Run to a place and read the machine there in one call | `c64_run_until` with `observe` and `history` |
|
|
37
|
+
| Each access or routine entry over many frames | `c64_trace` |
|
|
38
|
+
| Stop on an instruction address, stop on a memory access | `c64_breakpoint`, `c64_watchpoint` |
|
|
39
|
+
| Memory | `c64_memory_read`, `c64_memory_write`, `c64_memory_search`, `c64_memory_compare` |
|
|
40
|
+
| CPU registers | `c64_registers` |
|
|
41
|
+
| Code as it is in memory now | `c64_disassemble` |
|
|
42
|
+
| Executed instructions, call chain | `c64_cpu_history`, `c64_backtrace` |
|
|
43
|
+
| Cycles of each routine, memory use, cycles between two points | `c64_profile`, `c64_memmap`, `c64_timing` |
|
|
44
|
+
| Chips of the machine | `c64_vicii`, `c64_sprite`, `c64_cia`, `c64_sid` |
|
|
45
|
+
| Screen image, screen compare | `c64_screen` |
|
|
46
|
+
| Several of these from one moment | `c64_observe` |
|
|
47
|
+
| Keyboard, joystick | `c64_keyboard`, `c64_joystick` |
|
|
48
|
+
| Program and disk media | `c64_autostart`, `c64_program_load`, `c64_disk_attach` |
|
|
49
|
+
| Machine state to go back to, also in a later session | `c64_snapshot` |
|
|
50
|
+
|
|
51
|
+
Read the description of a tool before you use it for the first time. It gives the limits of the tool and the facts of the machine that change the result.
|
|
52
|
+
|
|
53
|
+
A result field `emulatorFlaw` names a known flaw of the emulator. Tell the user about the flaw. Do not use a result that the flaw can make wrong as a fact.
|
|
54
|
+
|
|
55
|
+
For a large result, give `out`. Write a file that is only for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. When a tool needs `project`, give the same folder as the `--project` of the skill scripts.
|
|
56
|
+
|
|
57
|
+
To keep a coverage run:
|
|
58
|
+
|
|
59
|
+
1. Clear the memory map with `c64_memmap` action `clear`.
|
|
60
|
+
2. Run the part of the program that you want to keep.
|
|
61
|
+
3. Read the map with `c64_memmap` action `read` and `out`, for example to `.c64-re-tools/local/attract.bin`.
|
|
62
|
+
4. Add the file to the knowledge with `coverage` of the c64-knowledge skill.
|
|
63
|
+
|
|
64
|
+
## Workflow
|
|
65
|
+
|
|
66
|
+
1. Read the project knowledge for the addresses in the question. Use the c64-knowledge skill.
|
|
67
|
+
2. Get the machine state with `c64_status`.
|
|
68
|
+
3. Load the subject if it is not loaded. Use `c64_autostart` to start it as a user does. Use `c64_program_load` to put a program in memory with no start.
|
|
69
|
+
4. Set the stop condition. Use a breakpoint, a watchpoint or a `c64_run_until` target. Add a condition when the stop must occur only in one state.
|
|
70
|
+
5. Run, step or give input. Prefer `c64_run_until` and `advance-frames` to waits. They stop at the same emulated time on every run.
|
|
71
|
+
6. Read only the state that answers the question. To read several things from one moment, use `c64_observe`.
|
|
72
|
+
7. Interpret the evidence. Keep the observed facts apart from your conclusions.
|
|
73
|
+
|
|
74
|
+
Before a risky experiment, save the state with `c64_snapshot`. Restore it to try again from the same point.
|
|
75
|
+
|
|
76
|
+
### Input that the tools cannot give
|
|
77
|
+
|
|
78
|
+
Some programs read input in a way that the input tools cannot give. The tool description tells when. Then use one of these ways:
|
|
79
|
+
|
|
80
|
+
- Open the window and ask the user to give the input.
|
|
81
|
+
- Record a session with a `press` step. Use `testing.ts record` of the c64-testing skill.
|
|
82
|
+
|
|
83
|
+
Do not change the program to make it accept the input.
|
|
84
|
+
|
|
85
|
+
### The window
|
|
86
|
+
|
|
87
|
+
The emulator has no window. When the user must type, play or look at the machine, do these steps:
|
|
88
|
+
|
|
89
|
+
1. Open the window with `c64_window` action `open`.
|
|
90
|
+
2. Tell the user that the window is open and what to do in it.
|
|
91
|
+
3. Wait until the user tells you that they finished.
|
|
92
|
+
4. Close the window with `c64_window` action `close`.
|
|
93
|
+
|
|
94
|
+
The result field `notCarried` names the data that the move cleared.
|
|
95
|
+
|
|
96
|
+
## Knowledge
|
|
97
|
+
|
|
98
|
+
Read:
|
|
99
|
+
- the current knowledge for each address and range that the question touches.
|
|
100
|
+
|
|
101
|
+
Automatic write:
|
|
102
|
+
- none.
|
|
103
|
+
|
|
104
|
+
Write after interpretation:
|
|
105
|
+
- a symbol, a region or a comment that the runtime evidence justifies. Record it with the c64-knowledge skill.
|
|
106
|
+
|
|
107
|
+
Do not store:
|
|
108
|
+
- breakpoints or watchpoints
|
|
109
|
+
- memory reads
|
|
110
|
+
- temporary machine state
|
|
111
|
+
- a screen capture, unless the user asks for it as an artifact
|
|
112
|
+
|
|
113
|
+
## Result
|
|
114
|
+
|
|
115
|
+
The result is the runtime state or evidence that the question asks for.
|
|
116
|
+
|
|
117
|
+
If you cannot get the machine into the necessary state, say which state you could not get. Say what you tried.
|
|
118
|
+
|
|
119
|
+
## Failure and conflicts
|
|
120
|
+
|
|
121
|
+
An error is `{"error": {"code": "...", "message": "..."}}`. The message tells what is wrong and what to do. Obey the message. These rules also apply:
|
|
122
|
+
|
|
123
|
+
- `installation-incomplete`, or `machine-unavailable` with a message that the host runtime does not run: stop the task. Give the message to the user and wait for the user. Do not make a replacement for the tool or the host runtime, for example your own disk parser, disassembler or emulator script. Do not try to repair the installation.
|
|
124
|
+
- `machine-unavailable` with a message that names a pause or a dialog in the window: do not send more operations. Give the message to the user. When the user tells you that the emulator runs again, do the operation again.
|
|
125
|
+
- `machine-unavailable` for a different cause: wait a few seconds. Then do the operation again one time. If you get the same error again, stop the task. Tell the user to restart the c64-re-tools MCP server, and wait for the user.
|
|
126
|
+
- `machine-state-lost`: do not use results from before the error. Do what the message tells. Then read the machine state again.
|
|
127
|
+
- `stopReason` `timeout` or `jam`: this is evidence too. Report it. For `jam`, report the address.
|
|
128
|
+
- A different code: the message names the cause. Change the call, or report the cause.
|
|
129
|
+
|
|
130
|
+
If the runtime evidence does not agree with the current knowledge, do not change the knowledge. Report the conflict and hand it to c64-knowledge.
|
|
131
|
+
|
|
132
|
+
## Handoffs
|
|
133
|
+
|
|
134
|
+
- Static explanation of code → c64-static-analysis
|
|
135
|
+
- Durable conclusion or a knowledge conflict → c64-knowledge
|
|
136
|
+
- Comparison or assertion between runs → c64-testing
|
|
137
|
+
- Meaning of a C64 address or register → c64-memory-map
|
package/src/cli/main.ts
CHANGED
|
@@ -36,7 +36,7 @@ project folder below the root uses that install; a project is a folder with
|
|
|
36
36
|
through npx. The Host Runtime runs on the machine with VICE: start it there
|
|
37
37
|
with npx -y --package=${PACKAGE.name}@${PACKAGE.tag} c64-re-tools-host.
|
|
38
38
|
It runs VICE and the tools that come with it (c1541, petcat). The skill
|
|
39
|
-
scripts run ACME, DXA, Ghidra and c64run in the dev container.`;
|
|
39
|
+
scripts run ACME, DXA, Exomizer, Ghidra and c64run in the dev container.`;
|
|
40
40
|
|
|
41
41
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
42
42
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// The byte check of a
|
|
2
|
-
// in the knowledge, segment by segment.
|
|
1
|
+
// The byte check of a program: a PRG against a reference program, for example
|
|
2
|
+
// the program in the knowledge, segment by segment.
|
|
3
3
|
|
|
4
|
-
import { formatC64Address, formatC64Byte, prgRange } from "
|
|
4
|
+
import { formatC64Address, formatC64Byte, prgRange } from "./c64.ts";
|
|
5
5
|
|
|
6
6
|
export interface SegmentCheck {
|
|
7
7
|
start: string;
|
|
@@ -47,3 +47,21 @@ export function compareBuild(prg: Uint8Array, program: Reference): { identical:
|
|
|
47
47
|
});
|
|
48
48
|
return { identical: checks.every((check) => check.result === "identical"), segments: checks };
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
/** PRG files merged in load order, as the reference of a check: a later file wins where two overlap. */
|
|
52
|
+
export function mergedPrograms(programs: ReadonlyArray<{ start: number; body: Uint8Array }>): Reference {
|
|
53
|
+
const memory = new Uint8Array(0x10000);
|
|
54
|
+
const loaded = new Uint8Array(0x10000);
|
|
55
|
+
for (const { start, body } of programs) {
|
|
56
|
+
memory.set(body, start);
|
|
57
|
+
loaded.fill(1, start, start + body.length);
|
|
58
|
+
}
|
|
59
|
+
const segments: Array<{ start: number; end: number }> = [];
|
|
60
|
+
for (let address = 0; address < 0x10000; address++) {
|
|
61
|
+
if (loaded[address] === 0) continue;
|
|
62
|
+
const last = segments.at(-1);
|
|
63
|
+
if (last !== undefined && last.end === address - 1) last.end = address;
|
|
64
|
+
else segments.push({ start: address, end: address });
|
|
65
|
+
}
|
|
66
|
+
return { segments, byteAt: (address) => memory[address]! };
|
|
67
|
+
}
|
|
@@ -19,6 +19,32 @@ export async function readCoverage(session: Pick<ViceSessionClient, "memmap">, s
|
|
|
19
19
|
return map;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** The I/O area. VICE maps every write there as an I/O write, also one with the RAM banked in by $01. */
|
|
23
|
+
export const IO_RAM = { start: 0xd000, end: 0xdfff } as const;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Marks the RAM writes under the I/O area in a map from $0000, from two reads
|
|
27
|
+
* of that RAM. The RAM there changes only by a write with the I/O area banked
|
|
28
|
+
* out. A run of written or changed bytes is RAM written when one byte of it
|
|
29
|
+
* changed: a byte written with the value that was there is part of it too.
|
|
30
|
+
* A run of register writes changes no RAM. `before` and `after` hold $d000-$dfff.
|
|
31
|
+
*/
|
|
32
|
+
export function markIoRamWrites(map: Uint8Array, before: Uint8Array, after: Uint8Array): void {
|
|
33
|
+
const size = IO_RAM.end - IO_RAM.start + 1;
|
|
34
|
+
const written = (offset: number) => before[offset] !== after[offset] || (map[IO_RAM.start + offset]! & (COVERAGE.ioWrite | COVERAGE.ramWrite)) !== 0;
|
|
35
|
+
for (let start = 0; start < size; ) {
|
|
36
|
+
if (!written(start)) {
|
|
37
|
+
start++;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
let end = start;
|
|
41
|
+
let changed = false;
|
|
42
|
+
for (; end < size && written(end); end++) changed ||= before[end] !== after[end];
|
|
43
|
+
if (changed) for (let offset = start; offset < end; offset++) map[IO_RAM.start + offset]! |= COVERAGE.ramWrite;
|
|
44
|
+
start = end;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
22
48
|
/** Runs of RAM that a program wrote, at least `minimum` bytes each, in a map from $0000. */
|
|
23
49
|
export function writtenBlocks(map: Uint8Array, minimum: number): CodeRange[] {
|
|
24
50
|
const blocks: CodeRange[] = [];
|
package/src/mcp/output.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { z } from "zod";
|
|
|
7
7
|
|
|
8
8
|
import { projectFolder, writeReported, type Written } from "../host-client/transfer.ts";
|
|
9
9
|
|
|
10
|
-
export const OutInput = z.string().min(1).describe("write the data to this file, relative to the project folder. An existing file is overwritten. The
|
|
10
|
+
export const OutInput = z.string().min(1).describe("write the data to this file, relative to the project folder. An existing file is overwritten. The result then gives the file (out), the number of bytes (bytes) and a SHA-256 (sha256) in place of the data");
|
|
11
11
|
|
|
12
12
|
/** The project of a tool with a path. */
|
|
13
13
|
export const ProjectInput = z
|
|
@@ -17,9 +17,9 @@ export const ProjectInput = z
|
|
|
17
17
|
|
|
18
18
|
/** The fields of a result with out, optional in an output schema that also has the inline form. */
|
|
19
19
|
export const WrittenOutput = {
|
|
20
|
-
out: z.string().optional(),
|
|
21
|
-
bytes: z.number().int().min(0).optional(),
|
|
22
|
-
sha256: z.string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
20
|
+
out: z.string().optional().describe("with out: the file that the tool wrote"),
|
|
21
|
+
bytes: z.number().int().min(0).optional().describe("with out: the number of bytes in the file"),
|
|
22
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/).optional().describe("with out: the SHA-256 of the file"),
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/** Lines as file text: each line ends with a newline, and no lines give an empty file. */
|
package/src/mcp/server.ts
CHANGED
|
@@ -274,10 +274,15 @@ function packageVersion(): string {
|
|
|
274
274
|
const INSTRUCTIONS =
|
|
275
275
|
"These tools control one live Commodore 64 emulator that belongs to this session. " +
|
|
276
276
|
"An address is a dollar sign and 1 to 4 hex digits, for example $c000 or $fb. A result gives four hex digits. " +
|
|
277
|
-
"An error is {\"error\": {\"code\", \"message\"}}. " +
|
|
277
|
+
"An error is {\"error\": {\"code\", \"message\"}}. The message tells what is wrong and what to do. " +
|
|
278
278
|
"Memory data is lowercase hex without separators. " +
|
|
279
279
|
"Other register values and chip values are decimal numbers. " +
|
|
280
|
-
"A read does not change the run state of the machine."
|
|
280
|
+
"A read does not change the run state of the machine. " +
|
|
281
|
+
"Space c64 is the computer. Space drive8 is the CPU of the 1541 disk drive. " +
|
|
282
|
+
"Memory view cpu gives what the CPU sees now, with ROM and I/O where the memory configuration puts them. Memory view ram gives the RAM under them. " +
|
|
283
|
+
"A write to memory or registers needs a stopped CPU: stop it with c64_execution action pause. " +
|
|
284
|
+
"Paths are relative to the project folder, the folder that holds .c64-re-tools/. " +
|
|
285
|
+
"With out, a tool writes a large result to a project file in place of the result.";
|
|
281
286
|
|
|
282
287
|
export function createMcpServer(options: { tools: readonly ToolDefinition[]; session: SessionSource; log?: (line: string) => void }): Server {
|
|
283
288
|
const tools = new Map(options.tools.map((tool) => [tool.name, tool]));
|
package/src/mcp/tools/debug.ts
CHANGED
|
@@ -44,7 +44,8 @@ export const c64Breakpoint = defineTool({
|
|
|
44
44
|
"Action add sets one at address in space c64 or drive8. With a condition, it stops only when the condition is true. " +
|
|
45
45
|
"add returns the new id. Breakpoints and watchpoints take their ids from one counter, so the ids of one kind can have gaps. " +
|
|
46
46
|
"Actions remove, enable and disable take that id. remove returns removed true and the id. Action list gives all breakpoints. Each breakpoint shows its condition, when it has one. " +
|
|
47
|
-
"Breakpoints stay through a reset."
|
|
47
|
+
"Breakpoints stay through a reset. " +
|
|
48
|
+
"In space drive8, the drive can execute a few more instructions before it stops. pc in the stop result is the drive address where it stopped.",
|
|
48
49
|
inputSchema: z
|
|
49
50
|
.object({
|
|
50
51
|
action: z.enum(CHECKPOINT_ACTIONS),
|
|
@@ -87,7 +88,8 @@ export const c64Watchpoint = defineTool({
|
|
|
87
88
|
`Action add sets one from start to end (at most ${MAX_WATCH_SIZE} bytes, end defaults to start), with access read, write or read-write. ` +
|
|
88
89
|
"With a condition, it stops only when the condition is true. For a write, a memory condition sees the memory after the write. " +
|
|
89
90
|
"add returns the new id. Breakpoints and watchpoints take their ids from one counter, so the ids of one kind can have gaps. " +
|
|
90
|
-
"Actions remove, enable and disable take that id. remove returns removed true and the id. Action list gives all watchpoints. Each watchpoint shows its condition, when it has one."
|
|
91
|
+
"Actions remove, enable and disable take that id. remove returns removed true and the id. Action list gives all watchpoints. Each watchpoint shows its condition, when it has one. " +
|
|
92
|
+
"In space drive8, the drive can execute a few more instructions before it stops. pc in the stop result is the drive address where it stopped.",
|
|
91
93
|
inputSchema: z
|
|
92
94
|
.object({
|
|
93
95
|
action: z.enum(CHECKPOINT_ACTIONS),
|
|
@@ -139,6 +141,7 @@ export const c64CpuHistory = defineTool({
|
|
|
139
141
|
"Each entry gives the address, the bytes, the instruction and the registers a, x, y and sp before the instruction executed. " +
|
|
140
142
|
"In space c64, it also gives the raster line and cycle when the instruction started. " +
|
|
141
143
|
"With out, it writes the entries as text lines to that project file, and the result gives the file in place of the entries. " +
|
|
144
|
+
"After a JAM, the emulator records no history until the next reset. If the CPU ran again after a snapshot restore, this tool refuses. Then use c64_reset, or use c64_trace. " +
|
|
142
145
|
"This does not change the run state of the machine.",
|
|
143
146
|
inputSchema: z.object({ limit: z.number().int().min(1).max(MAX_HISTORY).default(50), space: SpaceInput, out: OutInput.optional(), project: ProjectInput.optional() }).strict(),
|
|
144
147
|
outputSchema: z.object({
|
|
@@ -349,7 +352,7 @@ export const c64Memmap = defineTool({
|
|
|
349
352
|
start: AddressInput.optional().describe("read and summary. Default $0000"),
|
|
350
353
|
end: AddressInput.optional().describe("read and summary. Default $ffff"),
|
|
351
354
|
maxRanges: z.number().int().min(1).max(MAX_MEMMAP_RANGES).optional().describe("read without out only. Default 256"),
|
|
352
|
-
out: OutInput.optional().describe("read only: write a coverage map to this project file, one byte for each address. An existing file is overwritten"),
|
|
355
|
+
out: OutInput.optional().describe("read only: write a coverage map to this project file, one byte for each address. An existing file is overwritten. The result then gives the file, the number of bytes and a SHA-256"),
|
|
353
356
|
project: ProjectInput.optional().describe("read with out only: the project folder, relative to the folder where the agent started. Give it when that folder is not in a project and has projects below it"),
|
|
354
357
|
})
|
|
355
358
|
.strict(),
|
|
@@ -75,6 +75,7 @@ export const c64RunUntil = defineTool({
|
|
|
75
75
|
"reached tells if the target occurred. stopReason tells why the CPU stopped: target, breakpoint, watchpoint, jam (a JAM opcode) or timeout. " +
|
|
76
76
|
"pointId gives the id of the breakpoint or watchpoint that stopped the CPU. " +
|
|
77
77
|
"space tells which CPU stopped: c64, or drive8 for a stop in the disk drive. pc is the address in that space. " +
|
|
78
|
+
"The drive can execute a few more instructions before it stops. " +
|
|
78
79
|
"With observe, the result also gives what c64_observe gives at the stop, in observed. " +
|
|
79
80
|
`With history (1 to ${MAX_HISTORY}), it also gives the last instructions before the stop, as c64_cpu_history gives them. ` +
|
|
80
81
|
"Thus one call runs to a place and reads the machine there. " +
|
package/src/mcp/tools/input.ts
CHANGED
|
@@ -18,6 +18,7 @@ export const c64Keyboard = defineTool({
|
|
|
18
18
|
"No tool presses one key of the keyboard matrix. For one specific key, ask the user to press it in the window, or give a press step in a record file of c64-testing. " +
|
|
19
19
|
'Mode text types text, for example "RUN\\n". Letters of either case type the normal (unshifted) key. A line break types RETURN. ' +
|
|
20
20
|
"Mode petscii types PETSCII codes 1 to 255 in bytes, for example [147] to clear the screen. " +
|
|
21
|
+
"While c64_autostart loads a program, this tool refuses keys: see c64_autostart. " +
|
|
21
22
|
"This does not change the run state of the machine. emulatorFlaw in the result names a known flaw of the emulator version that affects input, and the version that fixes it.",
|
|
22
23
|
inputSchema: TOOL_INPUTS.keyboard,
|
|
23
24
|
outputSchema: z.object({ queuedBytes: z.number().int().min(1).max(MAX_KEYBOARD_BYTES), emulatorFlaw: EMULATOR_FLAW }),
|
package/src/mcp/tools/machine.ts
CHANGED
|
@@ -76,7 +76,7 @@ export const c64Reset = defineTool({
|
|
|
76
76
|
description:
|
|
77
77
|
"Reset the C64. Mode soft is the reset button. Mode hard is a power cycle that also resets the disk drive. " +
|
|
78
78
|
"With run false (the default), the CPU stops at the first instruction of the reset routine, and the result gives that program counter (pc). " +
|
|
79
|
-
"With run true, the C64 starts normally. Breakpoints and watchpoints stay.",
|
|
79
|
+
"With run true, the C64 starts normally. Breakpoints and watchpoints stay. The c64_timing stopwatch starts again from zero.",
|
|
80
80
|
inputSchema: z
|
|
81
81
|
.object({
|
|
82
82
|
mode: z.enum(RESET_MODES).describe("soft is the reset button. hard is a power cycle"),
|
package/src/mcp/tools/media.ts
CHANGED
|
@@ -29,7 +29,9 @@ export const c64Autostart = defineTool({
|
|
|
29
29
|
"Both joysticks are centred first: joystick port 1 uses the keyboard lines, and a held direction changes the RUN that the autostart types. " +
|
|
30
30
|
"Without index, a disk image loads like LOAD\"*\",8,1. index selects one directory entry by its number in the c64-disk directory list (0 is the first entry). " +
|
|
31
31
|
"The tool refuses an index of a DEL entry, or an index after the last entry. " +
|
|
32
|
-
"The machine runs when this tool returns, and the load continues."
|
|
32
|
+
"The machine runs when this tool returns, and the load continues. The emulator keeps warp mode on until it types RUN. " +
|
|
33
|
+
"A key in that time stops the autostart, so c64_keyboard refuses keys until then. Run frames with c64_execution advance-frames until c64_status gives warp false. " +
|
|
34
|
+
"The c64_timing stopwatch starts again from zero.",
|
|
33
35
|
inputSchema: z
|
|
34
36
|
.object({
|
|
35
37
|
path: ProjectPath,
|
|
@@ -107,7 +109,7 @@ export const c64Snapshot = defineTool({
|
|
|
107
109
|
.object({
|
|
108
110
|
action: z.enum(["save", "restore", "list", "remove"]),
|
|
109
111
|
name: TransientName.optional().describe("save and remove, and restore without file: 1 to 64 letters, digits, dots, underscores or hyphens"),
|
|
110
|
-
out: OutInput.optional().describe("save only: also write the snapshot to this project file, for example snapshots/room0.vsf. An existing file is overwritten"),
|
|
112
|
+
out: OutInput.optional().describe("save only: also write the snapshot to this project file, for example snapshots/room0.vsf. An existing file is overwritten. The result then also gives the file, the number of bytes and a SHA-256"),
|
|
111
113
|
file: ProjectPath.optional().describe("restore only: a .vsf file in the project, in place of name"),
|
|
112
114
|
project: ProjectInput.optional().describe("save with out, and restore with file: the project folder, relative to the folder where the agent started. Give it when that folder is not in a project and has projects below it"),
|
|
113
115
|
})
|
package/src/native/discover.ts
CHANGED
|
@@ -55,6 +55,14 @@ export const DXA: ToolSpec = {
|
|
|
55
55
|
remedy: INSTALL_STEPS,
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
export const EXOMIZER: ToolSpec = {
|
|
59
|
+
name: "Exomizer",
|
|
60
|
+
envVar: "C64RT_EXOMIZER",
|
|
61
|
+
binaries: ["exomizer"],
|
|
62
|
+
where: "on this machine",
|
|
63
|
+
remedy: INSTALL_STEPS,
|
|
64
|
+
};
|
|
65
|
+
|
|
58
66
|
export const C64RUN: ToolSpec = {
|
|
59
67
|
name: "c64run",
|
|
60
68
|
envVar: "C64RT_C64RUN",
|