@henols/c64-re-tools 2.3.0-rc.2 → 2.3.0-rc.4
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/package.json +2 -3
- package/skills/c64-assembler/SKILL.md +4 -6
- package/skills/c64-basic/SKILL.md +2 -4
- package/skills/c64-development/SKILL.md +3 -3
- package/skills/c64-disk/SKILL.md +3 -7
- package/skills/c64-docs/SKILL.md +2 -4
- package/skills/c64-export/SKILL.md +4 -4
- package/skills/c64-knowledge/SKILL.md +3 -3
- package/skills/c64-memory-map/SKILL.md +1 -3
- package/skills/c64-packer/SKILL.md +9 -11
- package/skills/c64-provenance/SKILL.md +3 -5
- package/skills/c64-reverse-engineering/SKILL.md +3 -3
- package/skills/c64-source/SKILL.md +18 -20
- package/skills/c64-static-analysis/SKILL.md +5 -5
- package/skills/c64-testing/SKILL.md +14 -13
- package/skills/c64-testing/references/recording-format.md +1 -1
- package/skills/c64-testing/references/scenario-format.md +3 -3
- package/skills/c64-unpacker/SKILL.md +11 -10
- package/skills/c64-unpacker/scripts/lib/loads.ts +2 -4
- package/skills/emulator/SKILL.md +5 -4
- package/src/cli/cleanup.ts +30 -0
- package/src/cli/main.ts +5 -1
- package/src/errors.ts +1 -0
- package/src/host/main.ts +1 -1
- package/src/host/tools/status.ts +1 -1
- package/src/host/vice/session.ts +29 -9
- package/src/host-client/vice-session.ts +1 -1
- package/src/mcp/tools/input.ts +4 -5
- package/src/mcp/tools/machine.ts +3 -7
- package/src/mcp/tools/media.ts +0 -1
- package/src/native/discover.ts +18 -6
- package/src/protocol/messages.ts +1 -1
- package/src/protocol/vice.ts +6 -12
- package/README.md +0 -143
|
@@ -17,9 +17,9 @@ A PASS proves only the behavior that the scenario does and observes. It does not
|
|
|
17
17
|
- The symbols of each side. For the original, the project knowledge. For the rebuild, the JSON output of the c64-assembler skill in a file.
|
|
18
18
|
- A scenario file: the steps, the checkpoints and the observations. See [references/scenario-format.md](references/scenario-format.md).
|
|
19
19
|
|
|
20
|
-
## Tools
|
|
20
|
+
## Tools
|
|
21
21
|
|
|
22
|
-
The script
|
|
22
|
+
The script runs the scenario on the original and then on the rebuild. Before each side, it does a hard reset. The CPU then stops at the reset vector.
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
node <skill>/scripts/testing.ts test tests/moves-left.json --out .c64-re-tools/local/results/moves-left
|
|
@@ -30,7 +30,7 @@ node <skill>/scripts/testing.ts checklist tests/moves-left.json --item 'FIRE sta
|
|
|
30
30
|
|
|
31
31
|
`testing.ts checklist` gives a Markdown checklist for a human tester in `text`.
|
|
32
32
|
|
|
33
|
-
Before the
|
|
33
|
+
Before the test starts, `testing.ts test` examines each file that the scenario names: the program and the symbols of each side, and each snapshot file. A missing file gives `not-found`. A program must be a PRG. The script refuses a disk, tape or cartridge image.
|
|
34
34
|
|
|
35
35
|
### Runs
|
|
36
36
|
|
|
@@ -53,7 +53,7 @@ The run file gives where to start (a program, or a snapshot file), the steps, an
|
|
|
53
53
|
| `{ "observe": "all3", "memory": "all" }` | Write all 64 KiB of RAM to `all3.bin`, also the RAM under the ROMs and the I/O area. |
|
|
54
54
|
| `{ "expect": "title", "memory": [{ "address": "$0400", "text": "HELLO" }], "registers": { "a": 0 } }` | Compare memory and registers with the expected values. `data` gives hex bytes, `text` gives screen codes. `mask` compares only some bits. A value that is not equal does not stop the run. |
|
|
55
55
|
|
|
56
|
-
Each step that writes a file must have its own file name. The script refuses a run where two steps write the same file, for example `{ "coverage": "x" }` and `{ "observe": "x", "memory": "all" }`, which both write `x.bin`. The script also examines the start program and each snapshot file before the
|
|
56
|
+
Each step that writes a file must have its own file name. The script refuses a run where two steps write the same file, for example `{ "coverage": "x" }` and `{ "observe": "x", "memory": "all" }`, which both write `x.bin`. The script also examines the start program and each snapshot file before the run starts.
|
|
57
57
|
|
|
58
58
|
A memory item can have `"view": "ram"`. Then it reads the RAM under the ROMs and the I/O area, for example code at `$e000` under the KERNAL. The default view `cpu` reads as the CPU sees memory. An item larger than 4096 bytes goes into its own `.bin` file, and `results.json` gives the file name.
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ See [references/scenario-format.md](references/scenario-format.md), section Runs
|
|
|
63
63
|
|
|
64
64
|
A recording keeps a session of the original program, for example a play through some rooms of a game. A replay gives the same input to a rebuild and compares the game state. Make the recordings early, before you change the program. A recording needs no names. Its coverage also helps the static analysis.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
The emulator tools cannot examine the C64 of a recording or a replay. That C64 has no disk drive. The program must be a PRG file.
|
|
67
67
|
|
|
68
68
|
Ask the user to play first. Tell the user which parts of the program the recordings must have, for example each room, a fight and a lost life. Make a scripted recording only for a part that the sessions of the user do not have, or when the user cannot play.
|
|
69
69
|
|
|
@@ -72,7 +72,7 @@ node <skill>/scripts/testing.ts record tests/record/start.json --out tests/recor
|
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
- With `--play`, a person plays the program after the steps of the record file. The steps can start the program, for example a key for an intro.
|
|
75
|
-
- The script writes the address of a page to stderr. Give the address to the user.
|
|
75
|
+
- The script writes the address of a page to stderr. Give the address to the user.
|
|
76
76
|
- The page shows the screen after the steps. The C64 is frozen until the user presses Enter or clicks Start. Tell the user to read the screen first.
|
|
77
77
|
- Give `--joystick` the port that the program reads: port 2 is `$DC00`, and port 1 is `$DC01`. Find the port in the code or in the knowledge. If you do not know the port, use 2. Tell the user that F9 changes the port.
|
|
78
78
|
- The page has the full C64 keyboard and the joystick. F10 changes the arrow keys and space between the joystick and the C64 keys. A gamepad is always the joystick. See the key maps in [references/recording-format.md](references/recording-format.md).
|
|
@@ -98,7 +98,7 @@ A checkpoint is one entry of a routine. Use a routine that the program executes
|
|
|
98
98
|
|
|
99
99
|
The input is the reads of the joystick ports and the keyboard matrix. It is also the reads of the four SID registers that a program can read: the paddles, the noise of voice 3 and its envelope. It is also the reads of `$DE00`-`$DFFF`, where a C64 without a cartridge gives the last byte on the bus. On a replay, the n-th read of each instruction gets the value of the n-th read in the recording. Thus a rebuild with different timing gets the same input and the same SID random numbers. A `press`, `joystick` or `frames` step is input. A `type`, `write`, `registers` or `runUntil` step is not input. The replay does that step again at the same read of the program.
|
|
100
100
|
|
|
101
|
-
A replay is deterministic.
|
|
101
|
+
A replay is deterministic. A replay has no random source and no clock: the same recording gives the same session, to the cycle. Sometimes the recording has no value for a read of an input. Then the read gets a fixed value: `$FF` for the joystick, keyboard and paddle registers, `$00` for the others. `idleReads` in the result counts these reads on the rebuild. On the original, such a read makes the result INCONCLUSIVE.
|
|
102
102
|
|
|
103
103
|
Control each source of random numbers:
|
|
104
104
|
|
|
@@ -119,7 +119,7 @@ node <skill>/scripts/testing.ts diff .c64-re-tools/local/runs/rooms/results.json
|
|
|
119
119
|
|
|
120
120
|
`testing.ts diff` tells what changed between two states of one kind. Use it in place of your own compare script.
|
|
121
121
|
|
|
122
|
-
- Two snapshot files: the
|
|
122
|
+
- Two snapshot files: the changed ranges of the RAM and of the colour RAM, and the changed VIC-II, CIA, SID and CPU registers.
|
|
123
123
|
- Two memory files of a run: the changed ranges. For a file of less than 64 KiB, `--address` gives the address of its first byte.
|
|
124
124
|
- Two observations of runs, also of one run: the changed memory items and registers. `compared` gives the count of items that both observations have. With `compared: 0`, `reason` tells what each observation has. Then the diff compared nothing, and the observations are not equal.
|
|
125
125
|
|
|
@@ -127,7 +127,7 @@ For two snapshot files, `$00` and `$01` are the CPU port of the snapshot: the di
|
|
|
127
127
|
|
|
128
128
|
`registers` gives each changed register and chip value. `cpu.pc` is a `$` address. Each CPU flag is `cpu.flags.<flag>`, for example `cpu.flags.c`, with `true` or `false`.
|
|
129
129
|
|
|
130
|
-
The script refuses a snapshot that does not restore
|
|
130
|
+
The script refuses a snapshot that does not restore. An example is a PAL snapshot with `--ntsc`. Give `--ntsc` only for snapshots of an NTSC machine.
|
|
131
131
|
|
|
132
132
|
`--gap N` joins ranges across N equal bytes. `--out` writes all ranges and all changed registers to a project file. The file uses the names of the result.
|
|
133
133
|
|
|
@@ -197,19 +197,20 @@ PASS, FAIL or INCONCLUSIVE, the checkpoints and the smallest differences that ex
|
|
|
197
197
|
- `not-found` before the run: a file of the scenario or the run file is missing, for example the rebuild program. Build the rebuild, or change the path.
|
|
198
198
|
- INCONCLUSIVE, "did not reach the checkpoint": one side did not reach the checkpoint in the frame limit. Find the reason with the emulator skill. Do not report a FAIL.
|
|
199
199
|
- INCONCLUSIVE, "has no symbol": one side has no symbol with that name. Add the name to the knowledge or to the rebuild source.
|
|
200
|
-
- INCONCLUSIVE, "no emulator" or "could not run": the
|
|
201
|
-
- `installation-incomplete
|
|
200
|
+
- INCONCLUSIVE, "no emulator" or "could not run": the emulator failed. Tell the user the message.
|
|
201
|
+
- `installation-incomplete` or `machine-unavailable`: stop the task. Give the message to the user and wait for the user. Do not install, start or change a tool yourself. Do not make a replacement for the tool, for example your own disk parser, disassembler or emulator script.
|
|
202
|
+
- `not-implemented`: the tool does not work in this setup. Give the message to the user. Do not use that tool or step again in this task.
|
|
202
203
|
- A FAIL with only a `screen` difference: add `vicii` or `sprites` to the observation to find which chip state is different.
|
|
203
204
|
- A program that uses random numbers: set the random seed with a `write` step on both sides. If that is not possible, observe only values that do not depend on the random numbers.
|
|
204
205
|
- The two sides start differently, for example the original after a cracked intro. Give the steps that only one side needs a `side`. Then make the memory the same with a `normalize` step. It writes the entry state of the capture in the knowledge.
|
|
205
206
|
- Frame counts drift by one frame between the sides: the sides got to the same address at different raster positions. Do not sync on an IRQ handler. Sync on a value that the IRQ changes, with a `runUntil` `memory` target. Or sync on an `address` target with a `raster` condition.
|
|
206
|
-
- INCONCLUSIVE, "does not reproduce": the original does not end the session with the recorded state. Record the session again
|
|
207
|
+
- INCONCLUSIVE, "does not reproduce": the original does not end the session with the recorded state. Record the session again.
|
|
207
208
|
- INCONCLUSIVE, "never came to the checkpoint": the original did not execute the checkpoint routine in the session. Give another routine.
|
|
208
209
|
- INCONCLUSIVE, "is not the program of the recording": the program file changed after the recording. Record the session again.
|
|
209
210
|
- A record result FAIL with `recorded` false: `reason` names the step that did not complete. Examples are a `runUntil` that did not reach its target, and a `type` step with too many keys. Change the step.
|
|
210
211
|
- A record result with `executed` 0: the program never read its input from RAM, so the coverage map is empty. The recording can still replay.
|
|
211
212
|
- A FAIL from a replay: compare the two RAM files of `--out` with `testing.ts diff`. Then examine the first different state item with the emulator skill.
|
|
212
|
-
- A program that loads more files from a disk:
|
|
213
|
+
- A program that loads more files from a disk: a recording has no disk drive. Use a test scenario in the emulator.
|
|
213
214
|
- A byte that cannot be the same on both sides, for example a read-only collision register: use `exclude` with the reason. Do not use `exclude` to hide a real difference.
|
|
214
215
|
|
|
215
216
|
Do not add a mask or a tolerance only to make a test pass. A tolerance must have a reason in the behavior of the program.
|
|
@@ -101,7 +101,7 @@ The page sends input only between Start and End. The input of the page goes into
|
|
|
101
101
|
|
|
102
102
|
A site is the address of the instruction that reads. The values are hex. `<from>` and `<count>` are decimal.
|
|
103
103
|
|
|
104
|
-
`testing.ts replay` checks `recording.json` before the replay
|
|
104
|
+
`testing.ts replay` checks `recording.json` before the replay starts. A recording of version 2.0 can have events or a comparison in the old form, for example `"at"` in place of `"address"`. The script refuses it with `invalid-input`. The message names the event, the old field and the form to write. Record the session again.
|
|
105
105
|
|
|
106
106
|
## Replay
|
|
107
107
|
|
|
@@ -156,11 +156,11 @@ Example: visit two rooms from the same start.
|
|
|
156
156
|
|
|
157
157
|
## Checks
|
|
158
158
|
|
|
159
|
-
The script checks the scenario before it
|
|
159
|
+
The script checks the scenario before it does a step. A step with an unknown key or a wrong value stops the script with `invalid-input`. The message names the step.
|
|
160
160
|
|
|
161
|
-
The script also examines each file before it
|
|
161
|
+
The script also examines each file before it does a step: the program and the symbols of each side, and each snapshot file. A missing file stops the script with `not-found`. A program that is not a PRG, for example a disk image, stops the script with `invalid-input`. A snapshot file that does not start with the signature of a VICE snapshot file also stops the script with `invalid-input`. The message names the step and the file.
|
|
162
162
|
|
|
163
|
-
A run also examines each name of its steps before it
|
|
163
|
+
A run also examines each name of its steps before it does a step. An unknown name stops the run with `invalid-input`, and the message names the step. In a scenario, a side that does not have a name gives INCONCLUSIVE, and `reason` names the step.
|
|
164
164
|
|
|
165
165
|
A step in the form of version 2.0 stops the script with `invalid-input`. The message names the old field and gives the step to write. For example, the script refuses `{ "runUntil": { "at": "main_loop" }, "timeoutFrames": 300 }` and gives `{"runUntil": {"target": {"kind": "address", "address": "main_loop"}, "timeoutFrames": 300}}`. A memory item with `at` gets the same refusal: write `address`.
|
|
166
166
|
|
|
@@ -16,7 +16,7 @@ This skill does not change project knowledge.
|
|
|
16
16
|
- The program: a PRG file, relative to the project folder. `inspect`, `trace`, `stages` and `capture` refuse a disk, tape or cartridge image. For such an image, use `loads`, or get the PRG with `disk.ts read` of the c64-disk skill.
|
|
17
17
|
- For a capture: the address where the unpacked program starts, and the directory for the result.
|
|
18
18
|
|
|
19
|
-
## Tools
|
|
19
|
+
## Tools
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
node <skill>/scripts/unpacker.ts inspect original/game.prg
|
|
@@ -26,7 +26,7 @@ node <skill>/scripts/unpacker.ts capture original/game.prg --until '$c000' --out
|
|
|
26
26
|
node <skill>/scripts/unpacker.ts loads original/game.d64 --steps .c64-re-tools/local/parts.json --out .c64-re-tools/local/parts --drive
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`inspect` examines the file
|
|
29
|
+
`inspect` examines the file and does not run the program. `trace`, `stages`, `capture` and `loads` run the program. `trace` runs the program and finds the memory that the program wrote and then executed. `stages` runs the program and finds each stage: a decruncher, an intro, a copier, and then the program. For each stage it gives the entry, the frames, the written memory (`wrote`) and the entry of the next stage (`next`). `wrote` lists each block that the stage wrote, also a small block. `capture` stops the program when the CPU gets to the `--until` address. In `stages` and `capture`, a `frames` step and a `runUntil` step to an address without a condition count as run time. `stages` refuses a different `runUntil` step.
|
|
30
30
|
|
|
31
31
|
| Option | Meaning |
|
|
32
32
|
|---|---|
|
|
@@ -43,9 +43,9 @@ 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. A segment can be in the RAM under the I/O area at `$d000`-`$dfff`.
|
|
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`. The script refuses an option that the command does not use. It refuses a wrong `--range` or `--exclude` before the program runs.
|
|
47
47
|
|
|
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
|
|
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 program runs. The message gives the file and the step. For example, wait 50 frames and type a space:
|
|
49
49
|
|
|
50
50
|
```json
|
|
51
51
|
[{ "frames": 50 }, { "type": { "mode": "text", "text": " " } }]
|
|
@@ -120,7 +120,7 @@ The scripts refuse a step in the form of version 2.0, for example `{ "runUntil":
|
|
|
120
120
|
|
|
121
121
|
## Multi-load programs
|
|
122
122
|
|
|
123
|
-
A multi-load program loads more parts from the disk while it runs, for example one part for each level. Use `loads` to capture each part. The program can be a PRG, or a disk, tape or cartridge image
|
|
123
|
+
A multi-load program loads more parts from the disk while it runs, for example one part for each level. Use `loads` to capture each part. The program can be a PRG, or a disk, tape or cartridge image. `loads` starts a PRG with RUN. Thus the PRG must have a BASIC start line. For a PRG without a BASIC start line, use `capture` with `--entry`.
|
|
124
124
|
|
|
125
125
|
1. Write a steps file. Put a `capture` step after each point where a part is in memory, for example:
|
|
126
126
|
|
|
@@ -139,7 +139,7 @@ A multi-load program loads more parts from the disk while it runs, for example o
|
|
|
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`.
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
No tool gives coverage of drive code.
|
|
143
143
|
|
|
144
144
|
## Knowledge
|
|
145
145
|
|
|
@@ -160,16 +160,17 @@ For `loads`: `captures`, with the name, the PC, the segments, `differsFromReset`
|
|
|
160
160
|
|
|
161
161
|
## Failure and conflicts
|
|
162
162
|
|
|
163
|
-
- `traced: false` or `followed: false`: the
|
|
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
|
|
163
|
+
- `traced: false` or `followed: false`: the C64 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
|
+
- `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 have no error.
|
|
165
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
|
-
- `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.
|
|
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.
|
|
169
169
|
- Do not name a packer from weak evidence. The script never names one.
|
|
170
170
|
- Some programs unpack in more than one stage. Run `stages` to find each stage. Capture at the entry of the last stage. Make sure that it is the application and not a second unpacker.
|
|
171
171
|
- `not-found` or `invalid-input`: a path or an argument is wrong. Read the message.
|
|
172
|
-
- `installation-incomplete
|
|
172
|
+
- `installation-incomplete` or `machine-unavailable`: stop the task. Give the message to the user and wait for the user. Do not install, start or change a tool yourself. Do not make a replacement for the tool, for example your own disk parser, disassembler or emulator script.
|
|
173
|
+
- `not-implemented`: the tool does not work in this setup. Give the message to the user. Do not use that tool or step again in this task.
|
|
173
174
|
|
|
174
175
|
## Handoffs
|
|
175
176
|
|
|
@@ -118,8 +118,6 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
118
118
|
let loadedProgram: Buffer | undefined;
|
|
119
119
|
/** False while the map holds the writes of the KERNAL RAM test. */
|
|
120
120
|
let writesKnown = true;
|
|
121
|
-
/** A known flaw of the host's VICE version that a tape load meets. */
|
|
122
|
-
let emulatorFlaw: string | undefined;
|
|
123
121
|
if (program.toLowerCase().endsWith(".prg")) {
|
|
124
122
|
const { bytes } = readProjectFile(program);
|
|
125
123
|
if (!(await autostartLoaded(client, program, bytes))) return { output: { loaded: false, reason: `The program was not in memory after ${LOAD_LIMIT_FRAMES} frames.`, captures: [] }, failed: true };
|
|
@@ -138,7 +136,7 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
138
136
|
// A disk, tape or cartridge: VICE loads and starts it. The RAM test of the KERNAL puts back what it writes.
|
|
139
137
|
previous = await readRam(client, 0x0000, 0x10000);
|
|
140
138
|
await client.memmap({ action: "clear" });
|
|
141
|
-
|
|
139
|
+
await client.autostart({ path: program, index: 0, run: true });
|
|
142
140
|
writesKnown = false;
|
|
143
141
|
if (!program.toLowerCase().endsWith(".crt")) {
|
|
144
142
|
// The map starts again where the KERNAL LOAD starts, after the RAM test: then it holds only what the program wrote.
|
|
@@ -228,7 +226,7 @@ export async function loads(program: string, options: { out: string; steps: Load
|
|
|
228
226
|
if (captures.length > 0 && captures.every((capture) => (capture.segments as unknown[]).length === 0)) {
|
|
229
227
|
const waits = captures.some((capture) => capture.keyWait === true) ? " The C64 waited for a key at READY. or at an INPUT statement, so the load ended or did not start." : "";
|
|
230
228
|
const reason = `No capture has a segment: the program changed no block of RAM from ${formatC64Address(FIRST_SEGMENT_ADDRESS)} on.${waits}`;
|
|
231
|
-
return { output: { loaded: false, reason, captures
|
|
229
|
+
return { output: { loaded: false, reason, captures }, failed: true };
|
|
232
230
|
}
|
|
233
231
|
return { output: { loaded: true, captures }, failed: false };
|
|
234
232
|
} finally {
|
package/skills/emulator/SKILL.md
CHANGED
|
@@ -21,13 +21,13 @@ The MCP server knows the machine and the emulator. Its instructions, its tool de
|
|
|
21
21
|
|
|
22
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
23
|
|
|
24
|
-
## Tools
|
|
24
|
+
## Tools
|
|
25
25
|
|
|
26
26
|
Use only the MCP tools. Each MCP session has its own machine. Nothing else can change that machine.
|
|
27
27
|
|
|
28
28
|
| Need | C64 tool |
|
|
29
29
|
|---|---|
|
|
30
|
-
| Run state, warp mode, window
|
|
30
|
+
| Run state, warp mode, window | `c64_status` |
|
|
31
31
|
| Reset, power cycle | `c64_reset` |
|
|
32
32
|
| Fast emulation | `c64_warp` |
|
|
33
33
|
| Show the machine to the user in a window, hide it again | `c64_window` |
|
|
@@ -91,7 +91,7 @@ The emulator has no window. When the user must type, play or look at the machine
|
|
|
91
91
|
3. Wait until the user tells you that they finished.
|
|
92
92
|
4. Close the window with `c64_window` action `close`.
|
|
93
93
|
|
|
94
|
-
The result field `notCarried` names the data that the
|
|
94
|
+
The result field `notCarried` names the data that the open or the close cleared.
|
|
95
95
|
|
|
96
96
|
## Knowledge
|
|
97
97
|
|
|
@@ -120,7 +120,8 @@ If you cannot get the machine into the necessary state, say which state you coul
|
|
|
120
120
|
|
|
121
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
122
|
|
|
123
|
-
- `installation-incomplete
|
|
123
|
+
- `installation-incomplete` or `machine-unavailable`: stop the task. Give the message to the user and wait for the user. Do not install, start or change a tool yourself. Do not make a replacement for the tool, for example your own disk parser, disassembler or emulator script.
|
|
124
|
+
- `not-implemented`: the tool does not work in this setup. Give the message to the user. Do not use that tool or step again in this task.
|
|
124
125
|
- `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
126
|
- `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
127
|
- `machine-state-lost`: do not use results from before the error. Do what the message tells. Then read the machine state again.
|
package/src/cli/cleanup.ts
CHANGED
|
@@ -177,6 +177,36 @@ export function tidyAfterUninstall(items: readonly InstallItem[], scope: Scope,
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* After an install or update: deletes the files of the items that the
|
|
182
|
+
* earlier install made and this one no longer has, for example a skill that
|
|
183
|
+
* a version renamed, then the directories that they leave empty. Only the
|
|
184
|
+
* harnesses that this install wrote count, and an MCP item never goes: its
|
|
185
|
+
* file holds other servers too. A file that this install also wrote stays.
|
|
186
|
+
* Returns the names of the removed items.
|
|
187
|
+
*/
|
|
188
|
+
export function removeDroppedItems(before: readonly InstallItem[], scope: Scope, cwd = process.cwd()): string[] {
|
|
189
|
+
const root = scopeRoot(scope, cwd);
|
|
190
|
+
const absolute = (file: string) => (isAbsolute(file) ? file : resolve(root, file));
|
|
191
|
+
const after = installedItems(scope, undefined, cwd);
|
|
192
|
+
const key = (item: InstallItem) => `${item.harness}/${item.kind}/${item.name}`;
|
|
193
|
+
const kept = new Set(after.map(key));
|
|
194
|
+
const harnesses = new Set(after.map((item) => item.harness));
|
|
195
|
+
const keptFiles = new Set(after.flatMap((item) => item.files.map(absolute)));
|
|
196
|
+
const dropped = before.filter((item) => item.kind !== "mcp" && harnesses.has(item.harness) && !kept.has(key(item)));
|
|
197
|
+
const directories = new Set<string>();
|
|
198
|
+
for (const item of dropped) {
|
|
199
|
+
for (const file of item.files.map(absolute)) {
|
|
200
|
+
if (keptFiles.has(file) || !isWithin(root, file)) continue;
|
|
201
|
+
if (existsSync(file)) unlinkSync(file);
|
|
202
|
+
directories.add(dirname(file));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Deepest first, so a parent is tried after its children.
|
|
206
|
+
for (const directory of [...directories].sort((a, b) => b.length - a.length)) removeEmptyDirectories(directory, root);
|
|
207
|
+
return [...new Set(dropped.map((item) => item.name))];
|
|
208
|
+
}
|
|
209
|
+
|
|
180
210
|
const ANSI = new RegExp(String.fromCharCode(27) + "\\[[0-9;]*m", "g");
|
|
181
211
|
|
|
182
212
|
/** AP SDK's report without its Windsurf MCP line and that line's detail, for when the CLI undid that item. */
|
package/src/cli/main.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { localToolStatus } from "../native/status.ts";
|
|
|
13
13
|
import { isRefusal } from "../errors.ts";
|
|
14
14
|
import { startTrace } from "../trace.ts";
|
|
15
15
|
import { runApSdk } from "./ap-sdk.ts";
|
|
16
|
-
import { installedItems, parseTargets, tidyAfterUninstall, undoWindsurfProjectMcp, windsurfBefore, withoutWindsurfMcp
|
|
16
|
+
import { installedItems, parseTargets, removeDroppedItems, tidyAfterUninstall, type Scope, undoWindsurfProjectMcp, windsurfBefore, withoutWindsurfMcp } from "./cleanup.ts";
|
|
17
17
|
import { hostStatusLines, installedLines, toolLines } from "./status.ts";
|
|
18
18
|
|
|
19
19
|
const HELP = `c64-re-tools: Commodore 64 reverse engineering and development
|
|
@@ -86,11 +86,15 @@ async function main(argv: string[]): Promise<number> {
|
|
|
86
86
|
case "install":
|
|
87
87
|
case "update": {
|
|
88
88
|
const before = windsurfBefore();
|
|
89
|
+
const earlier = installedItems(scope, targets);
|
|
89
90
|
const { code, output } = await apSdk("install", flags);
|
|
90
91
|
// A project install leaves the home directory as it was.
|
|
91
92
|
const note = scope === "project" && (targets === undefined || targets.includes("windsurf")) ? undoWindsurfProjectMcp(before) : undefined;
|
|
92
93
|
process.stdout.write(note === undefined ? output : withoutWindsurfMcp(output));
|
|
93
94
|
if (note !== undefined) console.log(` ${note}\n`);
|
|
95
|
+
// A skill that this version renamed or dropped must not stay next to the new ones.
|
|
96
|
+
const removed = code === 0 ? removeDroppedItems(earlier, scope) : [];
|
|
97
|
+
if (removed.length > 0) console.log(` Removed, because this version no longer has them: ${removed.join(", ")}\n`);
|
|
94
98
|
return code;
|
|
95
99
|
}
|
|
96
100
|
case "uninstall": {
|
package/src/errors.ts
CHANGED
package/src/host/main.ts
CHANGED
|
@@ -108,7 +108,7 @@ async function main(): Promise<number> {
|
|
|
108
108
|
log(`VICE ${vice.major}.${vice.minor}${vice.revision === undefined ? "" : ` r${vice.revision}`} starts`);
|
|
109
109
|
const flaws = viceFlaws(vice);
|
|
110
110
|
// A known VICE flaw is named, not worked around.
|
|
111
|
-
for (const flaw of flaws) log(`Known VICE flaw: ${flaw}`);
|
|
111
|
+
for (const flaw of flaws) log(`Known VICE flaw: ${flaw.text}`);
|
|
112
112
|
|
|
113
113
|
let server;
|
|
114
114
|
try {
|
package/src/host/tools/status.ts
CHANGED
|
@@ -41,7 +41,7 @@ export async function hostStatus(context: ToolContext, started?: ViceVersion): P
|
|
|
41
41
|
// VICE runs with its known flaws; status names them.
|
|
42
42
|
const vice = checked[0]!;
|
|
43
43
|
const version = vice.runs ? viceVersionOf(vice.version ?? "") : undefined;
|
|
44
|
-
const flaws = version === undefined ? [] : viceFlaws(version);
|
|
44
|
+
const flaws = version === undefined ? [] : viceFlaws(version).map((flaw) => flaw.text);
|
|
45
45
|
if (flaws.length > 0) checked[0] = { ...vice, flaws };
|
|
46
46
|
return { result: { host: { version: PACKAGE.version, platform: platform(), release: release(), arch: arch() }, tools: checked } };
|
|
47
47
|
}
|
package/src/host/vice/session.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { decodeProgramCounter, MonitorConnectionError, MonitorError, MonitorTime
|
|
|
31
31
|
import { decodeCia, decodeSid, decodeSprite, decodeVicii } from "./chips.ts";
|
|
32
32
|
import { compareFrames, differenceImage } from "./screen.ts";
|
|
33
33
|
import { isRefusal } from "../../errors.ts";
|
|
34
|
+
import type { ViceFeature, ViceFlaw } from "../../native/discover.ts";
|
|
34
35
|
import { checkMedia, hasSignature } from "../../media.ts";
|
|
35
36
|
import { launchVice, startErrorLines, type ViceMode, type ViceProcess } from "./process.ts";
|
|
36
37
|
import { TextMonitorError, TextMonitorTimeoutError } from "./text-monitor.ts";
|
|
@@ -125,12 +126,18 @@ export interface SessionOptions {
|
|
|
125
126
|
launch?: ViceLauncher;
|
|
126
127
|
/** Makes the host remove a path if it dies; returns the release. */
|
|
127
128
|
ownPath?: (path: string) => () => void;
|
|
128
|
-
/** The known flaws of this VICE version
|
|
129
|
-
flaws?: readonly
|
|
129
|
+
/** The known flaws of this VICE version: the tools that a flaw breaks refuse with not-implemented. */
|
|
130
|
+
flaws?: readonly ViceFlaw[];
|
|
130
131
|
/** Lists the entries of a disk image, so an autostart index is checked first. Without it, VICE gets the index unchecked. */
|
|
131
132
|
directory?: DiskDirectory;
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
/** The refusal of a tool that a known VICE flaw breaks: what does not work, and what to do. */
|
|
136
|
+
const BROKEN_MESSAGES: Record<ViceFeature, string> = {
|
|
137
|
+
joystick: "Joystick input is not implemented in this setup. Do not use the joystick in this task. Give this message to the user.",
|
|
138
|
+
tape: "The load of a tape image is not implemented in this setup. Do not load tape images in this task. Give this message to the user.",
|
|
139
|
+
};
|
|
140
|
+
|
|
134
141
|
export type DiskDirectory = (type: DiskImageType, image: Buffer) => Promise<DiskFile[]>;
|
|
135
142
|
|
|
136
143
|
/**
|
|
@@ -154,8 +161,8 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
154
161
|
#mode: ViceMode = "headless";
|
|
155
162
|
readonly #videoStandard: VideoStandard;
|
|
156
163
|
readonly #log: (line: string) => void;
|
|
157
|
-
/**
|
|
158
|
-
readonly #
|
|
164
|
+
/** What the known VICE flaws break, each with the text of its flaw. */
|
|
165
|
+
readonly #broken: ReadonlyMap<ViceFeature, string>;
|
|
159
166
|
readonly #untilReturnLimitMs: number;
|
|
160
167
|
readonly #stepLimitMs: number;
|
|
161
168
|
readonly #launch: ViceLauncher | undefined;
|
|
@@ -264,7 +271,7 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
264
271
|
this.#stepLimitMs = options.stepLimitMs ?? RUNNING_COMMAND_TIMEOUT_MS;
|
|
265
272
|
this.#launch = options.launch;
|
|
266
273
|
this.#directory = options.directory;
|
|
267
|
-
this.#
|
|
274
|
+
this.#broken = new Map((options.flaws ?? []).flatMap((flaw) => flaw.breaks.map((feature) => [feature, flaw.text] as const)));
|
|
268
275
|
this.#workDir = mkdtempSync(join(tmpdir(), "c64-re-tools-session-"));
|
|
269
276
|
this.#releaseWorkDir = options.ownPath?.(this.#workDir) ?? (() => {});
|
|
270
277
|
this.#watch(vice);
|
|
@@ -423,6 +430,7 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
423
430
|
return this.#programLoad(params as ViceOperations["programLoad"]["params"], onlyAttachment(attachments));
|
|
424
431
|
case "autostart": {
|
|
425
432
|
const { type, index, run } = params as ViceOperations["autostart"]["params"];
|
|
433
|
+
if (type === "tap") this.#refuseBroken("tape", "c64_autostart of a tape image");
|
|
426
434
|
const bytes = onlyAttachment(attachments);
|
|
427
435
|
checkMedia(type, bytes);
|
|
428
436
|
if (index > 0 && this.#directory !== undefined && isOneOf(DISK_IMAGE_TYPES, type)) checkDirectoryEntry(await this.#directory(type, bytes), index);
|
|
@@ -449,7 +457,7 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
449
457
|
this.#replaceStaged(stagedKind(type), file);
|
|
450
458
|
// A reset sets the CPU clock back, so the stopwatch starts again.
|
|
451
459
|
this.#timingStart = 0n;
|
|
452
|
-
return { state: "running", ...(
|
|
460
|
+
return { state: "running", ...(centred.length === 0 ? {} : { joysticksCentred: centred }) };
|
|
453
461
|
}
|
|
454
462
|
case "diskAttach": {
|
|
455
463
|
const { type } = params as ViceOperations["diskAttach"]["params"];
|
|
@@ -472,7 +480,7 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
472
480
|
);
|
|
473
481
|
}
|
|
474
482
|
await this.#observe(() => this.#machine.feedKeyboard(bytes));
|
|
475
|
-
return { queuedBytes: bytes.length
|
|
483
|
+
return { queuedBytes: bytes.length };
|
|
476
484
|
}
|
|
477
485
|
case "breakpoint":
|
|
478
486
|
return this.#breakpoint(params as BreakpointParams);
|
|
@@ -557,10 +565,11 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
557
565
|
case "observe":
|
|
558
566
|
return this.#observeAll(params as ObserveParams);
|
|
559
567
|
case "joystick": {
|
|
568
|
+
this.#refuseBroken("joystick", "c64_joystick");
|
|
560
569
|
const joystick = params as JoystickState;
|
|
561
570
|
await this.#observe(() => this.#machine.setJoystick(joystick));
|
|
562
571
|
this.#joysticks.set(joystick.port, joystick);
|
|
563
|
-
return
|
|
572
|
+
return joystick;
|
|
564
573
|
}
|
|
565
574
|
case "warp": {
|
|
566
575
|
const { enabled } = params as ViceOperations["warp"]["params"];
|
|
@@ -1172,6 +1181,17 @@ export class ViceSession implements ViceSessionHandle {
|
|
|
1172
1181
|
return publicView(point);
|
|
1173
1182
|
}
|
|
1174
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Refuses a tool that a known flaw of this VICE breaks: not-implemented for
|
|
1186
|
+
* the caller, without the VICE version, and the flaw on the host console.
|
|
1187
|
+
*/
|
|
1188
|
+
#refuseBroken(feature: ViceFeature, tool: string): void {
|
|
1189
|
+
const flaw = this.#broken.get(feature);
|
|
1190
|
+
if (flaw === undefined) return;
|
|
1191
|
+
this.#log(`${tool} was used, and this VICE does not support it. ${flaw}`);
|
|
1192
|
+
throw new WireFailure("not-implemented", BROKEN_MESSAGES[feature]);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1175
1195
|
/**
|
|
1176
1196
|
* Writes transferred bytes into the session directory. VICE reads an
|
|
1177
1197
|
* attached image from its file, so an image stays until another one
|
|
@@ -1818,7 +1838,7 @@ export function viceSessionFactory(options: {
|
|
|
1818
1838
|
env?: NodeJS.ProcessEnv;
|
|
1819
1839
|
log?: (line: string) => void;
|
|
1820
1840
|
/** The known flaws of the VICE version that the host checked at start. */
|
|
1821
|
-
flaws?: readonly
|
|
1841
|
+
flaws?: readonly ViceFlaw[];
|
|
1822
1842
|
directory?: DiskDirectory;
|
|
1823
1843
|
}): ViceSessionFactory {
|
|
1824
1844
|
return async ({ videoStandard, log = options.log ?? (() => {}) }) => {
|
|
@@ -134,7 +134,7 @@ export class ViceSessionClient {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/** Autostarts a project program or image, as VICE's autostart does. `root` is the project folder; it stays on this side. */
|
|
137
|
-
async autostart(params: { path: string; index: number; run: boolean; root?: string }): Promise<{ state: RunState
|
|
137
|
+
async autostart(params: { path: string; index: number; run: boolean; root?: string }): Promise<{ state: RunState }> {
|
|
138
138
|
const file = readProjectFile(params.path, params.root === undefined ? { what: "path" } : { root: params.root, what: "path" });
|
|
139
139
|
return this.#request("autostart", { type: file.type, index: params.index, run: params.run }, [file.bytes]);
|
|
140
140
|
}
|
package/src/mcp/tools/input.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { keyboardBytes } from "../../host-client/steps.ts";
|
|
|
7
7
|
import { TOOL_INPUTS } from "../inputs.ts";
|
|
8
8
|
import { defineTool } from "../server.ts";
|
|
9
9
|
|
|
10
|
-
const EMULATOR_FLAW = z.string().optional().describe("a known flaw of the emulator version that affects input, and the version that fixes it");
|
|
11
10
|
|
|
12
11
|
export const c64Keyboard = defineTool({
|
|
13
12
|
name: "c64_keyboard",
|
|
@@ -19,9 +18,9 @@ export const c64Keyboard = defineTool({
|
|
|
19
18
|
'Mode text types text, for example "RUN\\n". Letters of either case type the normal (unshifted) key. A line break types RETURN. ' +
|
|
20
19
|
"Mode petscii types PETSCII codes 1 to 255 in bytes, for example [147] to clear the screen. " +
|
|
21
20
|
"While c64_autostart loads a program, this tool refuses keys: see c64_autostart. " +
|
|
22
|
-
"This does not change the run state of the machine.
|
|
21
|
+
"This does not change the run state of the machine.",
|
|
23
22
|
inputSchema: TOOL_INPUTS.keyboard,
|
|
24
|
-
outputSchema: z.object({ queuedBytes: z.number().int().min(1).max(MAX_KEYBOARD_BYTES)
|
|
23
|
+
outputSchema: z.object({ queuedBytes: z.number().int().min(1).max(MAX_KEYBOARD_BYTES) }),
|
|
25
24
|
readOnly: false,
|
|
26
25
|
async run(input, session) {
|
|
27
26
|
// The schema checked the keys: keyboardBytes gives bytes here.
|
|
@@ -36,9 +35,9 @@ export const c64Joystick = defineTool({
|
|
|
36
35
|
description:
|
|
37
36
|
"Set the joystick in control port 1 or 2: a direction (or center) and the fire button. " +
|
|
38
37
|
"The C64 sees this state until you change it. To release the joystick, set direction center and fire false. " +
|
|
39
|
-
"Most games read port 2. This does not change the run state of the machine.
|
|
38
|
+
"Most games read port 2. This does not change the run state of the machine.",
|
|
40
39
|
inputSchema: TOOL_INPUTS.joystick,
|
|
41
|
-
outputSchema: z.object({ port: z.union([z.literal(1), z.literal(2)]), direction: z.enum(JOYSTICK_DIRECTIONS), fire: z.boolean()
|
|
40
|
+
outputSchema: z.object({ port: z.union([z.literal(1), z.literal(2)]), direction: z.enum(JOYSTICK_DIRECTIONS), fire: z.boolean() }),
|
|
42
41
|
readOnly: false,
|
|
43
42
|
async run(input, session) {
|
|
44
43
|
return session.joystick(input);
|
package/src/mcp/tools/machine.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
import { formatC64Address } from "../../c64.ts";
|
|
6
|
-
import { PACKAGE } from "../../package.ts";
|
|
7
6
|
import { VIDEO_STANDARDS } from "../../protocol/messages.ts";
|
|
8
7
|
import { POINT_STOP_REASONS, RESET_MODES, RUN_STATES, SPACES, WINDOW_ACTIONS } from "../../protocol/vice.ts";
|
|
9
8
|
import { AddressOutput, defineTool } from "../server.ts";
|
|
@@ -16,8 +15,7 @@ export const c64Status = defineTool({
|
|
|
16
15
|
"and if warp mode is on. It also tells if the emulator window is open (window). " +
|
|
17
16
|
"When the CPU has stopped, the result also gives the program counter (pc). " +
|
|
18
17
|
"When a breakpoint, a watchpoint or a JAM opcode stopped the CPU, stopReason tells which, and pointId gives the id of the breakpoint or watchpoint. " +
|
|
19
|
-
"cartridge is true while a cartridge from c64_autostart is attached: a reset keeps it, and an autostart of another file detaches it.
|
|
20
|
-
"version is the c64-re-tools version of this MCP server.",
|
|
18
|
+
"cartridge is true while a cartridge from c64_autostart is attached: a reset keeps it, and an autostart of another file detaches it.",
|
|
21
19
|
inputSchema: z.object({}).strict(),
|
|
22
20
|
outputSchema: z.object({
|
|
23
21
|
state: z.enum(RUN_STATES),
|
|
@@ -29,7 +27,6 @@ export const c64Status = defineTool({
|
|
|
29
27
|
pointId: z.number().int().min(1).optional().describe("the id of the breakpoint or watchpoint that stopped the CPU"),
|
|
30
28
|
space: z.enum(SPACES).optional().describe("with pc: c64, or drive8 when a breakpoint or watchpoint in the disk drive stopped the CPU. pc is the address in that space"),
|
|
31
29
|
cartridge: z.boolean().describe("true while a cartridge from c64_autostart is attached"),
|
|
32
|
-
version: z.string().describe("the c64-re-tools version of this MCP server"),
|
|
33
30
|
}),
|
|
34
31
|
readOnly: true,
|
|
35
32
|
async run(_input, session) {
|
|
@@ -40,7 +37,6 @@ export const c64Status = defineTool({
|
|
|
40
37
|
warp: status.warp,
|
|
41
38
|
window: status.window,
|
|
42
39
|
cartridge: status.cartridge,
|
|
43
|
-
version: PACKAGE.version,
|
|
44
40
|
...(status.pc === undefined ? {} : { pc: formatC64Address(status.pc) }),
|
|
45
41
|
...(status.stopReason === undefined ? {} : { stopReason: status.stopReason }),
|
|
46
42
|
...(status.pointId === undefined ? {} : { pointId: status.pointId }),
|
|
@@ -53,7 +49,7 @@ export const c64Window = defineTool({
|
|
|
53
49
|
name: "c64_window",
|
|
54
50
|
title: "Emulator window",
|
|
55
51
|
description:
|
|
56
|
-
"Show the C64 in a window
|
|
52
|
+
"Show the C64 in a window, or hide it again. The emulator has no window until you open one. " +
|
|
57
53
|
"Open the window when the user must type, play or look at the C64. Then tell the user. Wait until the user tells you that they finished. " +
|
|
58
54
|
"Then close the window. The machine, the disk in drive 8, breakpoints, watchpoints, joysticks, warp mode and c64_timing go along. " +
|
|
59
55
|
"The run state of the machine does not change. The result names the data that does not go along (notCarried). " +
|
|
@@ -98,7 +94,7 @@ export const c64Warp = defineTool({
|
|
|
98
94
|
name: "c64_warp",
|
|
99
95
|
title: "Warp mode",
|
|
100
96
|
description:
|
|
101
|
-
"Turn warp mode on or off. In warp mode the C64 runs as fast as
|
|
97
|
+
"Turn warp mode on or off. In warp mode the C64 runs as fast as possible. " +
|
|
102
98
|
"Warp mode does not change what the C64 does. This does not change the run state of the machine.",
|
|
103
99
|
inputSchema: z.object({ enabled: z.boolean().describe("true turns warp mode on") }).strict(),
|
|
104
100
|
outputSchema: z.object({ enabled: z.boolean() }),
|
package/src/mcp/tools/media.ts
CHANGED
|
@@ -42,7 +42,6 @@ export const c64Autostart = defineTool({
|
|
|
42
42
|
.strict(),
|
|
43
43
|
outputSchema: z.object({
|
|
44
44
|
state: z.enum(RUN_STATES),
|
|
45
|
-
emulatorFlaw: z.string().optional().describe("for a tape image: a known flaw of this VICE version that stops a tape load"),
|
|
46
45
|
joysticksCentred: z.array(z.union([z.literal(1), z.literal(2)])).optional().describe("the joystick ports that held a direction or fire and were centred before the reset"),
|
|
47
46
|
}),
|
|
48
47
|
readOnly: false,
|