@henols/c64-re-tools 2.6.0-rc.4 → 2.6.0-rc.6
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 +1 -1
- package/skills/c64-assembler/SKILL.md +2 -2
- package/skills/c64-assembler/scripts/assembler.ts +4 -5
- package/skills/c64-development/SKILL.md +1 -1
- package/skills/c64-docs/SKILL.md +4 -4
- package/skills/c64-docs/scripts/docs.ts +3 -3
- package/skills/c64-docs/scripts/lib/reference.ts +3 -3
- package/skills/c64-docs/scripts/lib/source-map.ts +9 -4
- package/skills/c64-knowledge/SKILL.md +26 -17
- package/skills/c64-knowledge/scripts/knowledge.ts +26 -41
- package/skills/c64-provenance/SKILL.md +11 -10
- package/skills/c64-provenance/scripts/lib/library.ts +16 -16
- package/skills/c64-provenance/scripts/provenance.ts +33 -23
- package/skills/c64-reverse-engineering/SKILL.md +6 -6
- package/skills/c64-source/SKILL.md +15 -15
- package/skills/c64-source/scripts/lib/source.ts +9 -9
- package/skills/c64-source/scripts/source.ts +79 -65
- package/skills/c64-static-analysis/SKILL.md +4 -4
- package/skills/c64-static-analysis/scripts/static-analysis.ts +26 -33
- package/src/build-name.ts +3 -0
- package/src/knowledge/program.ts +44 -1
- package/src/knowledge/read.ts +3 -7
- package/src/knowledge/schema.ts +33 -9
- package/src/knowledge/text.ts +4 -2
- package/src/knowledge/write.ts +47 -14
- package/src/project.ts +13 -1
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@ To get the command list, run the script with no arguments.
|
|
|
30
30
|
| Build a generated source with the values of `config.asm` | `build src main.asm` |
|
|
31
31
|
| Build the loader of a generated source | `build src loader.asm` |
|
|
32
32
|
| Check that the rebuild is identical to the program in the project knowledge | `build src main.asm --compare` |
|
|
33
|
-
| Build a release and check it against the
|
|
33
|
+
| Build a release and check it against the bytes of that release | `build src main.asm --release ORIGINAL --compare` |
|
|
34
34
|
| Check the rebuild of a program in another space, for example the drive | `build src main.asm --out build/drive.prg --compare --space drive8` |
|
|
35
35
|
| List all symbols, also the constants that the source does not use | `build src main.a --out build/game.prg --all-symbols --max-listed 500` |
|
|
36
36
|
| Write only the bytes of the program, without the load address | `build src main.a --out build/game.bin --plain` |
|
|
@@ -100,7 +100,7 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
100
100
|
| `--include <folder>` | `build` | An include folder: a path relative to the source root, inside the project folder. Give the flag again for each folder. The default is no include folder. |
|
|
101
101
|
| `--define NAME=VALUE` | `build` | An assembler symbol: an integer, also `$` and hex digits, or `true` or `false`. Give the flag again for each symbol. Do not use it for a switch. |
|
|
102
102
|
| `--set-pc <address>` | `build` | The start address when the source does not set one, for example `'$0801'`. |
|
|
103
|
-
| `--release <label>` | `build` | Build a release of the project knowledge. Each switch gets the value of that release. With `--compare`, the reference is the
|
|
103
|
+
| `--release <label>` | `build` | Build a release of the project knowledge. Each switch gets the value of that release. With `--compare`, the reference is the bytes of the release in the project knowledge. |
|
|
104
104
|
| `--compare` | `build` | Compare the program byte by byte with the program in the project knowledge, or with the file of `--release`, segment by segment. Off by default. |
|
|
105
105
|
| `--space <space>` | `build` | The space of the program in the project knowledge: `c64`, `drive8`, `loading`, or `bank0` to `bank255`. The default is `c64`. Give it only with `--compare` or `--release`. |
|
|
106
106
|
| `--plain` | `build` | Write only the bytes of the program, without the 2-byte load address. Off by default. |
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// The c64-assembler script: assembles project source with ACME, which it runs
|
|
2
2
|
// itself, and writes the program into the project.
|
|
3
3
|
|
|
4
|
-
import { type BuildKind, buildName, CONFIG_FILE, configValues, symbolsPath } from "#src/build-name.ts";
|
|
4
|
+
import { BUILD_DIRECTORY, type BuildKind, buildName, CONFIG_FILE, configValues, symbolsPath } from "#src/build-name.ts";
|
|
5
5
|
import { formatC64Address } from "#src/c64.ts";
|
|
6
6
|
import { Refusal } from "#src/errors.ts";
|
|
7
|
-
import { readImage } from "#src/host-client/image.ts";
|
|
8
7
|
import { readSourceTree, writeReported } from "#src/host-client/transfer.ts";
|
|
9
8
|
import { openForRead } from "#src/knowledge/database.ts";
|
|
10
9
|
import { knowledgeNames } from "#src/knowledge/names.ts";
|
|
11
|
-
import { requireProgram } from "#src/knowledge/program.ts";
|
|
10
|
+
import { releaseImage, requireProgram } from "#src/knowledge/program.ts";
|
|
12
11
|
import { listSwitches, releaseLabeled } from "#src/knowledge/read.ts";
|
|
13
12
|
import { LEFTOVERS_SWITCH, RELEASE_DEFINE, START_SCREEN_SWITCH, type Space } from "#src/knowledge/schema.ts";
|
|
14
13
|
import { assemble, showSymbol, symbolsFileText } from "#src/native/acme.ts";
|
|
@@ -77,7 +76,7 @@ await runScript({
|
|
|
77
76
|
const release = releaseLabeled(db, label, call.space);
|
|
78
77
|
if (release === undefined) throw new Refusal("not-found", `There is no release ${label} in the knowledge. Record the release in the project knowledge first, or give the label of a recorded release.`);
|
|
79
78
|
releaseDefine = { [`${RELEASE_DEFINE}${label}`]: 1 };
|
|
80
|
-
if (call.flag("compare")) program =
|
|
79
|
+
if (call.flag("compare")) program = releaseImage(db, label, call.space);
|
|
81
80
|
}
|
|
82
81
|
} finally {
|
|
83
82
|
db?.close();
|
|
@@ -90,7 +89,7 @@ await runScript({
|
|
|
90
89
|
const config = tree.files.findIndex((file) => file.path === (tree.sourceDir === "" ? CONFIG_FILE : `${tree.sourceDir}/${CONFIG_FILE}`));
|
|
91
90
|
const kind: BuildKind | undefined = label !== undefined ? { release: label } : config < 0 ? undefined : { values: configValues(contents[config]!.toString("utf8")), defaults: switchDefaults(call.space) };
|
|
92
91
|
const plain = call.flag("plain");
|
|
93
|
-
const out = call.string("out") ??
|
|
92
|
+
const out = call.string("out") ?? `${BUILD_DIRECTORY}/${buildName(entry, kind)}.${plain ? "bin" : "prg"}`;
|
|
94
93
|
const params: AcmeParams = { ...tree, entrySource: entry, defines: { ...releaseDefine, ...Object.fromEntries(call.strings("define").map(parseDefine)) }, ...(setPc === undefined ? {} : { setPc }) };
|
|
95
94
|
|
|
96
95
|
const { result, attachments } = await assemble(params, contents, localToolContext());
|
|
@@ -29,7 +29,7 @@ First select the path:
|
|
|
29
29
|
|
|
30
30
|
- The project has no program yet: path A.
|
|
31
31
|
- The program has source that a person wrote: path B. A project that an export of a rebuilt program made also takes path B.
|
|
32
|
-
- The source comes from a generation from the project knowledge: path C. Such a source has `main.asm
|
|
32
|
+
- The source comes from a generation from the project knowledge: path C. Such a source has `main.asm`, and the first line of each generated file tells that it is generated. Do not edit this source. The next generation of the source writes over it.
|
|
33
33
|
|
|
34
34
|
### Acceptance checks
|
|
35
35
|
|
package/skills/c64-docs/SKILL.md
CHANGED
|
@@ -41,7 +41,7 @@ The documentation is Markdown in the project. It has two parts:
|
|
|
41
41
|
|
|
42
42
|
Get the values for the commands from these places:
|
|
43
43
|
|
|
44
|
-
- `<source-dir>` and `--source`: the folder of the source that you generated from the project knowledge, for example `src`.
|
|
44
|
+
- `<source-dir>` and `--source`: the folder of the source that you generated from the project knowledge, for example `src`. The source must be from the current revision of the project knowledge.
|
|
45
45
|
- `--out`: a folder that holds only the reference, for example `docs/reference`. Keep the pages that you write outside it.
|
|
46
46
|
- `<page>`: the entry page `README.md` and the folder of the other pages, for example `docs`.
|
|
47
47
|
- The program bytes: put them into the project knowledge before `generate`. Then the reference decodes the tables and shows the graphics.
|
|
@@ -84,7 +84,7 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
84
84
|
| Flag | Command | Effect |
|
|
85
85
|
|---|---|---|
|
|
86
86
|
| `--out <dir>` | `generate` | Required. The folder of the reference, relative to the project folder. `generate` writes only there. It refuses to start when the folder holds a page that it did not write. |
|
|
87
|
-
| `--source <dir>` | `link` | Required. The folder of the generated source,
|
|
87
|
+
| `--source <dir>` | `link` | Required. The folder of the generated source, relative to the project folder. In a group folder, each project has its source in this folder. |
|
|
88
88
|
| `--reference <dir>` | `link` | The folder of the reference, relative to the project folder. In a group folder, each project has its reference in this folder. The default is the first `reference` folder in a given folder or beside a given page, for example `docs/reference`. |
|
|
89
89
|
| `--check` | `link` | Write nothing. `result` is `FAIL` when a link is not up to date or a page has a problem. Off by default. |
|
|
90
90
|
| `--max-listed <n>` | `generate`, `link` | List at most `n` items in each list. The default is 50. The count is always in the body. |
|
|
@@ -121,7 +121,7 @@ In a call graph, a solid arrow is a call, a thick arrow is a table entry, and a
|
|
|
121
121
|
|
|
122
122
|
Errors and their actions:
|
|
123
123
|
|
|
124
|
-
- `not-found` for
|
|
124
|
+
- `not-found` for the source map or for the source folder: generate the source from the project knowledge. Then run `generate` again.
|
|
125
125
|
- `invalid-input` that names an old revision: the project knowledge changed after you generated the source. Generate the source again, then run `generate` again.
|
|
126
126
|
- `invalid-input` that names a page in `--out`: `generate` did not write that page. Move the page out of the folder.
|
|
127
127
|
- `conflict`: the project knowledge has conflicts from a git merge. Resolve the merge conflicts of the project knowledge. Then generate the source again, and run `generate` again.
|
|
@@ -208,7 +208,7 @@ Errors:
|
|
|
208
208
|
## Workflow
|
|
209
209
|
|
|
210
210
|
1. Read the project knowledge. The documentation can only be as good as the knowledge. Each routine needs a name and a comment. Each table needs a region and a name. Each file of the source needs a module with a title. Record what is missing in the project knowledge.
|
|
211
|
-
2. Generate the source from the project knowledge. Make sure that the check of the source gives identical bytes. This also writes
|
|
211
|
+
2. Generate the source from the project knowledge. Make sure that the check of the source gives identical bytes. This also writes the source map.
|
|
212
212
|
3. Run `generate`. Read `index.md` of the reference. A module with no routines, or a routine with no comment, shows what the knowledge does not have yet.
|
|
213
213
|
4. Make the plan of the pages. Start from the modules and the call graphs. Find the main loop, the interrupt chain, the dispatch tables, the state machines and the data formats. Each subsystem gets one page in `docs/`. The entry page `README.md` lists the pages. Use the page types in `<skill>/references/page-types.md`.
|
|
214
214
|
5. Collect the facts about the development and the copy protection. These facts are the most interesting parts for a reader, so look for them carefully.
|
|
@@ -67,7 +67,7 @@ function generate(call: Call): Reply {
|
|
|
67
67
|
const revision = currentRevision(db);
|
|
68
68
|
// A source of another revision has other lines: the links would point to the wrong code.
|
|
69
69
|
if (map.revision !== revision) {
|
|
70
|
-
throw new WireFailure("invalid-input", `${map.
|
|
70
|
+
throw new WireFailure("invalid-input", `${map.mapPath} is from knowledge revision ${map.revision}, and the knowledge is at revision ${revision}. Nothing was written. Generate the source again from the knowledge. Then run generate again.`);
|
|
71
71
|
}
|
|
72
72
|
knowledge = {
|
|
73
73
|
revision,
|
|
@@ -272,7 +272,7 @@ function link(call: Call): Reply {
|
|
|
272
272
|
db?.close();
|
|
273
273
|
}
|
|
274
274
|
if (map.revision !== revision) {
|
|
275
|
-
problems.push({ page: inProject(map.
|
|
275
|
+
problems.push({ page: inProject(map.mapPath), line: 1, kind: "stale-reference", message: `The source${of} is from knowledge revision ${map.revision}, and the knowledge is at ${revision}. Generate the source and the reference again, then run docs.ts link.` });
|
|
276
276
|
}
|
|
277
277
|
const addresses = new Map<string, number>();
|
|
278
278
|
for (const label of map.labels) addresses.set(label.name, label.address);
|
|
@@ -411,7 +411,7 @@ function link(call: Call): Reply {
|
|
|
411
411
|
return reply({ result: problems.length > 0 || (check && links > 0) ? "FAIL" : "PASS", ...output }, { ...(hints.length === 0 ? {} : { hint: hints.join(" ") }), nextAction });
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
const SOURCE = { kind: "path", value: "<dir>", help: "the folder of the source that was generated from the knowledge,
|
|
414
|
+
const SOURCE = { kind: "path", value: "<dir>", help: "the folder of the source that was generated from the knowledge, relative to the project folder" } as const;
|
|
415
415
|
|
|
416
416
|
await runScript({
|
|
417
417
|
name: "docs",
|
|
@@ -34,8 +34,8 @@ export interface ReferenceFile {
|
|
|
34
34
|
bytes: Buffer;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/** Files that the source map lists but that hold no code of the program. */
|
|
38
|
-
const NOT_PIECES = new Set(["main.asm", "constants.asm", "macros.asm", "loader.asm"]);
|
|
37
|
+
/** Files that the source map lists but that hold no code of the program: they get no module page. */
|
|
38
|
+
const NOT_PIECES = new Set(["main.asm", "constants.asm", "macros.asm", "loader.asm", "config.asm", "switches.asm", "start_screen.asm", "start_screen_stage.asm"]);
|
|
39
39
|
const TABLE_TYPES: readonly RegionType[] = [...POINTER_TABLE_TYPES, "jumps", "words"];
|
|
40
40
|
const GRAPHICS_TYPES: readonly RegionType[] = ["sprite", "bitmap", "charset", "screen"];
|
|
41
41
|
/** A list longer than this ends with the number of the rest. */
|
|
@@ -194,7 +194,7 @@ export function buildReference(input: ReferenceInput): { files: ReferenceFile[];
|
|
|
194
194
|
}
|
|
195
195
|
const titleOf = (file: string) => input.modules.find((module) => module.file === file)?.title;
|
|
196
196
|
|
|
197
|
-
const header = `${GENERATED_MARK} from knowledge revision ${input.revision} and ${map.
|
|
197
|
+
const header = `${GENERATED_MARK} from knowledge revision ${input.revision} and ${map.mapPath}. Do not edit: change the knowledge, generate the source again, then run docs.ts generate. -->`;
|
|
198
198
|
const files: ReferenceFile[] = [];
|
|
199
199
|
const write = (path: string, lines: string[]) => files.push({ path, bytes: Buffer.from(`${[header, ...lines].join("\n").replace(/\n{3,}/g, "\n\n")}\n`, "utf8") });
|
|
200
200
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
// The source map
|
|
2
|
-
//
|
|
1
|
+
// The source map of a generated source: the line of each name and of each
|
|
2
|
+
// address. The generation writes it to the local folder of the project, not
|
|
3
|
+
// next to the source. The documentation links to these lines.
|
|
3
4
|
|
|
4
5
|
import { posix } from "node:path";
|
|
5
6
|
|
|
@@ -7,6 +8,7 @@ import { parseC64Address } from "#src/c64.ts";
|
|
|
7
8
|
import { WireFailure } from "#src/host-client/tools.ts";
|
|
8
9
|
import { readProjectFile } from "#src/host-client/transfer.ts";
|
|
9
10
|
import type { Space } from "#src/knowledge/schema.ts";
|
|
11
|
+
import { generatedDirectory } from "#src/project.ts";
|
|
10
12
|
|
|
11
13
|
export const SOURCE_MAP_FILE = "source-map.json";
|
|
12
14
|
|
|
@@ -18,6 +20,8 @@ export interface SourceLine {
|
|
|
18
20
|
export interface SourceMap {
|
|
19
21
|
/** The source directory, relative to the project folder. */
|
|
20
22
|
directory: string;
|
|
23
|
+
/** The source map file, relative to the project folder. */
|
|
24
|
+
mapPath: string;
|
|
21
25
|
space: Space;
|
|
22
26
|
revision: string;
|
|
23
27
|
files: string[];
|
|
@@ -30,9 +34,9 @@ export interface SourceMap {
|
|
|
30
34
|
pathOf: (file: string) => string;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
/** Reads
|
|
37
|
+
/** Reads the source map of the source in `directory` of the project `root`. A missing map is a refusal with the remedy. */
|
|
34
38
|
export function readSourceMap(directory: string, root?: string): SourceMap {
|
|
35
|
-
const path = posix.join(directory, SOURCE_MAP_FILE);
|
|
39
|
+
const path = posix.join(generatedDirectory(directory), SOURCE_MAP_FILE);
|
|
36
40
|
let text: string;
|
|
37
41
|
try {
|
|
38
42
|
text = readProjectFile(path, root === undefined ? {} : { root }).bytes.toString("utf8");
|
|
@@ -59,6 +63,7 @@ export function readSourceMap(directory: string, root?: string): SourceMap {
|
|
|
59
63
|
const byName = new Map(labels.map((label) => [label.name, label]));
|
|
60
64
|
return {
|
|
61
65
|
directory,
|
|
66
|
+
mapPath: path,
|
|
62
67
|
space: String(raw.space ?? "c64") as Space,
|
|
63
68
|
revision: String(raw.revision),
|
|
64
69
|
files: (raw.files as unknown[]).map(String),
|
|
@@ -46,7 +46,7 @@ The knowledge is text in `.c64-re-tools/knowledge/` of the project. Commit that
|
|
|
46
46
|
| Write a comment | `comment '$2100' line Reads joystick 2.` |
|
|
47
47
|
| Add a reference | `reference '$2000' '$2100' call` |
|
|
48
48
|
| Find the places that a removal blocks | `suppressions --range '$2000-$2fff'` |
|
|
49
|
-
| Start a file of the generated source | `module '$2000' player.asm --title 'Player movement'` |
|
|
49
|
+
| Start a file of the generated source | `module '$2000' game/player.asm --title 'Player movement'` |
|
|
50
50
|
| Write the operand of an instruction as an expression | `operand '$8079' --lo irq_handler` |
|
|
51
51
|
| Record a release of the program | `release ORIGINAL --file original/game.prg --base` |
|
|
52
52
|
| Write a switch | `switch PROTECTION --kind protection --releases ORIGINAL` |
|
|
@@ -58,7 +58,8 @@ The knowledge is text in `.c64-re-tools/knowledge/` of the project. Commit that
|
|
|
58
58
|
| Write a macro | `macro inc16 --params dst --body-file inc16.asm` |
|
|
59
59
|
| Write instructions as one use of a macro | `use '$1005-$100a' inc16 --args ptr` |
|
|
60
60
|
| Do many writes as one revision | `apply .c64-re-tools/local/batch.json` |
|
|
61
|
-
|
|
|
61
|
+
| Show the batches of parallel agents as one list of writes | `join a.json b.json` |
|
|
62
|
+
| Write the batches of parallel agents as one revision | `join a.json b.json --apply` |
|
|
62
63
|
| Read the history of an address or a name | `history '$2100'` |
|
|
63
64
|
| Read the last revisions | `revisions` |
|
|
64
65
|
| Go back to an earlier state | `revert 20261015T2145` |
|
|
@@ -74,7 +75,7 @@ The knowledge is text in `.c64-re-tools/knowledge/` of the project. Commit that
|
|
|
74
75
|
- A symbol name is a label for ACME: a letter or an underscore, then letters, digits or underscores. The knowledge refuses the name of a 6502 instruction, for example `lda`, in upper or lower case.
|
|
75
76
|
- A space is `c64` (the default), `drive8` for code in the 1541 drive, `loading` or `bank0` to `bank255`. `loading` is the captured stage of the loading that shows the start screen. `bank0` to `bank255` are cartridge banks. Drive code, the stage and banks use the same addresses as the C64. Thus each space has its own knowledge. A name is unique in one space.
|
|
76
77
|
- A revision id has the form `20261015T214501.123-k3f9qz`. It starts with the date and the time. Give the full id, or a start of the id that only one revision has. Get the ids from `revisions`, or from the `revision` field of a result. The revision `0` is the knowledge before the first revision.
|
|
77
|
-
- A file of a capture is the `image.json` that the capture of a packed program wrote.
|
|
78
|
+
- A file of a capture is the `image.json` that the capture of a packed program wrote. The other files of the capture must be next to it.
|
|
78
79
|
|
|
79
80
|
### Paths and the project folder
|
|
80
81
|
|
|
@@ -107,9 +108,13 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
107
108
|
| `--reason <text>` | All commands in "Change the knowledge" | Why you make the change. The revision keeps it, and `history` shows it. |
|
|
108
109
|
| `--evidence <kind:ref>` | All commands in "Change the knowledge" | One thing that the change rests on: `coverage:<map>`, `test:<file>`, `file:<file>` or `note:<text>`. You can give it more than one time. |
|
|
109
110
|
| `--expect-revision <revision>` | All commands in "Change the knowledge" | Refuse the change when the knowledge changed after this revision. Give the `revision` of your last read. |
|
|
111
|
+
| `--by <user\|llm>` | `join` | With `--apply`: the same as for the commands in "Change the knowledge". |
|
|
112
|
+
| `--reason <text>` | `join` | With `--apply`: the same as for the commands in "Change the knowledge". |
|
|
113
|
+
| `--evidence <kind:ref>` | `join` | With `--apply`: the same as for the commands in "Change the knowledge". |
|
|
114
|
+
| `--expect-revision <revision>` | `join` | With `--apply`: the same as for the commands in "Change the knowledge". |
|
|
110
115
|
| `--range <start>-<end>` | `symbols`, `regions`, `comments`, `references`, `suppressions`, `modules`, `operands`, `patches`, `uses`, `export` | Only the rows in this range. The default is all addresses. |
|
|
111
116
|
| `--origin <origin>` | `search`, `symbols`, `regions`, `comments`, `references`, `modules`, `operands`, `patches`, `macros`, `uses`, `export` | Only the rows of these origins: `user`, `llm`, `dxa`, `ghidra`, `heuristic`, `semantic` (user and llm), `analyzer` (dxa, ghidra and heuristic), or a comma list. The default is all origins. |
|
|
112
|
-
| `--max-listed <n>` | `search`, `symbols`, `regions`, `comments`, `references`, `suppressions`, `modules`, `operands`, `patches`, `switches`, `releases`, `macros`, `uses`, `spaces`, `history`, `revisions`, `revision`, `listing` | The most items in each list of the body. The default is 50. The counts are always complete. |
|
|
117
|
+
| `--max-listed <n>` | `search`, `symbols`, `regions`, `comments`, `references`, `suppressions`, `modules`, `operands`, `patches`, `switches`, `releases`, `macros`, `uses`, `spaces`, `history`, `revisions`, `revision`, `listing`, `join` | The most items in each list of the body. The default is 50. The counts are always complete. |
|
|
113
118
|
| `--kind <kind>` | `symbols`, `rename` | The symbol kind: `label`, `routine`, `variable`, `data` or `vector`. A read gives all kinds by default. A new symbol without `--kind` is a `label`. A `rename` without `--kind` keeps the kind of the symbol. |
|
|
114
119
|
| `--kind <kind>` | `references` | Only references of this kind: `call`, `jump`, `read`, `write`, `reference` or `pointer`. |
|
|
115
120
|
| `--kind <kind>` | `switch` | Necessary. The switch kind: `protection`, `trainer`, `cheat`, `crack`, `fix` or `change`. |
|
|
@@ -121,7 +126,8 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
121
126
|
| `--macro <name>` | `history` | The history of a macro in place of an address. |
|
|
122
127
|
| `--name <name>` | `history` | The history of a name in place of an address. |
|
|
123
128
|
| `--before <revision>` | `revisions` | Only the revisions before this one. |
|
|
124
|
-
| `--out <file>` | `export
|
|
129
|
+
| `--out <file>` | `export` | Necessary. The JSON file to write. |
|
|
130
|
+
| `--apply` | `join` | Write the joined writes to the project knowledge as one revision. Without it, `join` writes nothing. |
|
|
125
131
|
| `--out <file>` | `listing` | Write the listing as text to this file in place of the lines in the body. |
|
|
126
132
|
| `--element <n>` | `classify` | The bytes of one element of a table. The length of the range must be a multiple of it. |
|
|
127
133
|
| `--title <text>` | `module` | The title of the file. A `module` write without a title keeps the title that the module has. |
|
|
@@ -218,7 +224,7 @@ When a git merge left conflicts in the knowledge, each read body also has `confl
|
|
|
218
224
|
|
|
219
225
|
### `releases`
|
|
220
226
|
|
|
221
|
-
- `body.releases` lists the releases, the base release first. Each item has `label`, `
|
|
227
|
+
- `body.releases` lists the releases, the base release first. Each item has `label`, `base` and `define`.
|
|
222
228
|
- `define` is the assembler define that builds the release.
|
|
223
229
|
|
|
224
230
|
### `macros`
|
|
@@ -347,8 +353,10 @@ Errors of this group:
|
|
|
347
353
|
|
|
348
354
|
- A module tells where a file of the generated source starts. The file runs to the next module or to the end of its segment.
|
|
349
355
|
- Each address has one module, and each file name has one module.
|
|
350
|
-
- A file name has letters, digits, underscores or hyphens, and ends in `.asm`. It
|
|
351
|
-
-
|
|
356
|
+
- A file name has letters, digits, underscores or hyphens, and ends in `.asm`. It can have one folder, for example `music/driver.asm`. A folder name has lower-case letters, digits, underscores or hyphens.
|
|
357
|
+
- Put the modules of one part of the program in one folder, for example `music/`, `irq/` or `graphics/`.
|
|
358
|
+
- The generated source has the files `main.asm`, `loader.asm`, `switches.asm`, `config.asm`, `constants.asm`, `macros.asm` and `start_screen.asm` already. It also has the folders `leftovers/` and `segments/`. Thus a module cannot have one of these files, also in a folder, or one of these folders, in upper or lower case.
|
|
359
|
+
- Two modules cannot have file names that are different only in upper or lower case.
|
|
352
360
|
- The title becomes the first line of the file.
|
|
353
361
|
- `body.module` gives the module after the write.
|
|
354
362
|
|
|
@@ -387,12 +395,13 @@ A rebuild keeps all of the program in the source: unused bytes, dead code, old c
|
|
|
387
395
|
|
|
388
396
|
Do not write a file of the rebuild by hand, for example a boot file, a packed picture or a script that changes bytes. Record each change in the knowledge, and generate the source.
|
|
389
397
|
|
|
390
|
-
-
|
|
398
|
+
- `--file` is a PRG or the `image.json` of a capture. The project knowledge keeps the bytes of the release. After the write, the project does not need the file. A capture can stay in `.c64-re-tools/local/`.
|
|
391
399
|
- A label is upper case, for example `ORIGINAL`, `FIRESTAR` or `V2`.
|
|
392
400
|
- The base release is the release whose bytes are the program of the knowledge. Record it with `--base`. The script refuses `--base` when the segments or the bytes of the file are not the program.
|
|
393
401
|
- A space has one base release. Record the base release before the first switch.
|
|
394
|
-
- The build of a release gives each switch the value of that release. The check of the generated source compares that build with the bytes of the
|
|
395
|
-
-
|
|
402
|
+
- The build of a release gives each switch the value of that release. The check of the generated source compares that build with the bytes of the release in the project knowledge.
|
|
403
|
+
- To change the bytes of a release, record the release again with its new file.
|
|
404
|
+
- `body.release` gives the release, with its `define`. `body.bytes` gives the number of bytes of the file.
|
|
396
405
|
|
|
397
406
|
### `unrelease <label>`
|
|
398
407
|
|
|
@@ -539,7 +548,7 @@ A macro writes a run of instructions as one line of the source, for example `+in
|
|
|
539
548
|
### `apply <file>`
|
|
540
549
|
|
|
541
550
|
- `<file>` is a JSON list of writes. Give `-` to read the list from standard input.
|
|
542
|
-
- `body` holds `revision`, `writes` and `replaced`.
|
|
551
|
+
- `body` holds `revision`, `writes` and `replaced`. `replaced` lists each write that replaced a row of a different origin, for example an `llm` write over a `user` row. Each item has the number of the `write`, its `op` and its `previous`. A write over a row of the same origin is not in `replaced`.
|
|
543
552
|
- All writes become one revision. If the knowledge refuses one write, the script writes nothing, and the `error` names the write.
|
|
544
553
|
- Each write has `op` and the fields of the command with the same name. Each write can also have `space`. For example:
|
|
545
554
|
|
|
@@ -572,7 +581,6 @@ A macro writes a run of instructions as one line of the source, for example `+in
|
|
|
572
581
|
| `unuse` | `start` |
|
|
573
582
|
|
|
574
583
|
- The script checks an `operand`, `patch` or `use` write against the program of its space.
|
|
575
|
-
- Apply a batch from a library match or an idiom search in the same way. Read the notes of the result that wrote the batch first.
|
|
576
584
|
|
|
577
585
|
### `revert <revision>`
|
|
578
586
|
|
|
@@ -590,19 +598,20 @@ A macro writes a run of instructions as one line of the source, for example `+in
|
|
|
590
598
|
|
|
591
599
|
## Batches of parallel agents
|
|
592
600
|
|
|
593
|
-
When more agents name the program at the same time, give each agent one range of addresses. Each agent writes one batch file and does not apply it. A batch has the form `{"owner": {"start": "$1000", "end": "$1fff"}, "ops": [...]}`. `ops` holds the writes, as for `apply`. The owner ranges must not overlap.
|
|
601
|
+
When more agents name the program at the same time, give each agent one range of addresses. Each agent writes one batch file in `.c64-re-tools/local/` and does not apply it. A batch has the form `{"owner": {"start": "$1000", "end": "$1fff"}, "ops": [...]}`. `ops` holds the writes, as for `apply`. The owner ranges must not overlap.
|
|
594
602
|
|
|
595
603
|
### `join <batch>...`
|
|
596
604
|
|
|
597
|
-
- `join` makes one
|
|
598
|
-
- `body` holds `writes`, `repeated
|
|
605
|
+
- `join` makes one list of writes from two or more batch files. Without `--apply`, it writes no knowledge.
|
|
606
|
+
- Without `--apply`, `body` holds `writes`, `repeated` and `choices`. `writes` lists the joined writes.
|
|
607
|
+
- With `--apply`, `join` writes the joined writes as one revision, or nothing when the knowledge refuses one write. Then `body` holds `revision`, `writes`, `replaced`, `repeated` and `choices`, as for `apply`.
|
|
599
608
|
- `choices` lists each place where the batches gave different values, with the value that stays.
|
|
600
609
|
- At an address in the owner range of a batch, the name, the comment, the operand and the module of that batch stay. At an address that no batch owns, the first batch in the command stays.
|
|
601
610
|
- A batch can give an address a name that `join` replaces. Then `join` also replaces that name in the operand expressions and macro arguments of that batch.
|
|
602
611
|
- The regions of the owner come after the regions of the other batches. Thus the regions of the owner stay where they overlap.
|
|
603
612
|
- A name from a batch stays when another batch removes the symbol at that address.
|
|
604
613
|
- When one name or one module file is at two addresses, `join` writes nothing and gives the error `conflict`. The `error` names the addresses and the batches. Correct the batches. Then do `join` again.
|
|
605
|
-
-
|
|
614
|
+
- Without `--apply`, the `hint` tells you to examine `choices` and `writes`. `nextAction` is the same `join` with `--apply`. Run it when the choices agree with your task.
|
|
606
615
|
|
|
607
616
|
---
|
|
608
617
|
|
|
@@ -17,7 +17,7 @@ import { operandText } from "#src/knowledge/expression.ts";
|
|
|
17
17
|
import { historyAt, historyNamed, historyOfMacro, historyOfSwitch, revision, revisionNote, revisions, type HistoryEntry } from "#src/knowledge/history.ts";
|
|
18
18
|
import { joinBatches, type Batch, type JoinChoice, type JoinClash } from "#src/knowledge/join.ts";
|
|
19
19
|
import { knowledgeNames } from "#src/knowledge/names.ts";
|
|
20
|
-
import { addCoverage, programCoverage, programImage, requireProgram, setImage, type ImageRequest } from "#src/knowledge/program.ts";
|
|
20
|
+
import { addCoverage, memoryRows, operandImages as programImages, programCoverage, programImage, requireProgram, setImage, type ImageRequest } from "#src/knowledge/program.ts";
|
|
21
21
|
import { startScreenOfStage } from "#src/knowledge/start-screen.ts";
|
|
22
22
|
import {
|
|
23
23
|
analyzerNamesAt,
|
|
@@ -159,8 +159,6 @@ const switchRow = (row: SwitchRow, base?: string, patches?: readonly PatchRow[])
|
|
|
159
159
|
const release = (row: ReleaseRow) => ({
|
|
160
160
|
...spaceOf(row),
|
|
161
161
|
label: row.label,
|
|
162
|
-
file: row.file,
|
|
163
|
-
sha256: row.sha256,
|
|
164
162
|
base: row.base,
|
|
165
163
|
define: `--define ${RELEASE_DEFINE}${row.label}=1`,
|
|
166
164
|
...(row.comment === undefined ? {} : { comment: row.comment }),
|
|
@@ -361,23 +359,9 @@ function imageRequest(path: string, space: string): ImageRequest {
|
|
|
361
359
|
return request;
|
|
362
360
|
}
|
|
363
361
|
|
|
364
|
-
/**
|
|
365
|
-
* The program of each space in the knowledge that operand, patch and macro
|
|
366
|
-
* use writes in that space are checked against, with the platform names. A
|
|
367
|
-
* byte outside the segments of the program is not in it. Each program is
|
|
368
|
-
* read once, when a write in its space needs it.
|
|
369
|
-
*/
|
|
362
|
+
/** The programs that operand, patch and macro use writes are checked against, with the platform names. */
|
|
370
363
|
function operandImages(db: DatabaseSync): (space: string) => OperandImage {
|
|
371
|
-
|
|
372
|
-
return (space) => {
|
|
373
|
-
const known = images.get(space);
|
|
374
|
-
if (known !== undefined) return known;
|
|
375
|
-
const image = requireProgram(db, space);
|
|
376
|
-
const inside = (at: number) => image.segments.some((segment) => at >= segment.start && at <= segment.end);
|
|
377
|
-
const made: OperandImage = { byteAt: (at) => (inside(at) ? image.byteAt(at) : undefined), platform: new Map(platformNames().map((entry) => [entry.name, entry.address])) };
|
|
378
|
-
images.set(space, made);
|
|
379
|
-
return made;
|
|
380
|
-
};
|
|
364
|
+
return programImages(db, new Map(platformNames().map((entry) => [entry.name, entry.address])));
|
|
381
365
|
}
|
|
382
366
|
|
|
383
367
|
/** An offset: a whole number in decimal or $ hex, with an optional minus sign. */
|
|
@@ -905,27 +889,23 @@ const WRITE_COMMANDS: CommandSpec[] = [
|
|
|
905
889
|
writeCommand(
|
|
906
890
|
{
|
|
907
891
|
name: "release",
|
|
908
|
-
summary: "Records a release of the program
|
|
892
|
+
summary: "Records a release of the program from its PRG or the image.json of its capture: the knowledge keeps the bytes of the release. The base release is the one whose bytes are the program of the knowledge.",
|
|
909
893
|
subjects: [{ name: "<label>", help: "the release label, for example ORIGINAL or FIRESTAR" }],
|
|
910
894
|
options: {
|
|
911
|
-
file: { kind: "path", value: "<file>", help: "the PRG or image.json of the release,
|
|
895
|
+
file: { kind: "path", value: "<file>", help: "the PRG or image.json of the release. After the write, the knowledge does not need the file", required: true },
|
|
912
896
|
base: { kind: "flag", help: "this release is the program of the knowledge: its segments and bytes must be the same" },
|
|
913
897
|
comment: { kind: "text", value: "<text>", help: "what the release is, for example the group and the date" },
|
|
914
898
|
},
|
|
915
|
-
notes: "The build of a release defines RELEASE_<label>=1: each switch then has the value of that release. The check of the generated source builds each release and compares it with the bytes of
|
|
899
|
+
notes: "The build of a release defines RELEASE_<label>=1: each switch then has the value of that release. The check of the generated source builds each release and compares it with the bytes of the release in the knowledge.",
|
|
916
900
|
},
|
|
917
901
|
(call) => {
|
|
918
902
|
const context = contextOf(call);
|
|
919
903
|
const file = knowledgePath(call.string("file")!, "--file");
|
|
920
|
-
const root = projectRoot();
|
|
921
|
-
if (isInside(join(root, PROJECT_DIRECTORY, LOCAL_DIRECTORY), resolveProjectPath(file, root))) {
|
|
922
|
-
throw new UsageError(`--file ${file} is in ${PROJECT_DIRECTORY}/${LOCAL_DIRECTORY}/, which git ignores. Move the release to a folder that git keeps, for example original/.`);
|
|
923
|
-
}
|
|
924
904
|
const image = readImage(file);
|
|
925
|
-
const sha256 = createHash("sha256").update(readProjectFile(file).bytes).digest("hex");
|
|
926
905
|
const commentText = call.string("comment");
|
|
927
906
|
const base = call.flag("base");
|
|
928
|
-
|
|
907
|
+
// The base release has no bytes of its own: its bytes are the program.
|
|
908
|
+
const request = { space: call.space, label: call.subject(0), ...(base ? { base } : { rows: memoryRows(image.segments, image.byteAt) }), ...(commentText === undefined ? {} : { comment: commentText }) };
|
|
929
909
|
return (db) => {
|
|
930
910
|
if (base) {
|
|
931
911
|
const program = requireProgram(db, call.space);
|
|
@@ -935,7 +915,8 @@ const WRITE_COMMANDS: CommandSpec[] = [
|
|
|
935
915
|
});
|
|
936
916
|
if (!same) throw new Refusal("invalid-input", `The bytes of ${file} are not the program of the knowledge. Give --base only to the release whose file image put into the knowledge.`);
|
|
937
917
|
}
|
|
938
|
-
|
|
918
|
+
const bytes = image.segments.reduce((sum, segment) => sum + segment.end - segment.start + 1, 0);
|
|
919
|
+
return { ...shown(setRelease(db, context, request), "release", release), bytes };
|
|
939
920
|
};
|
|
940
921
|
},
|
|
941
922
|
),
|
|
@@ -1134,22 +1115,25 @@ const WRITE_COMMANDS: CommandSpec[] = [
|
|
|
1134
1115
|
}
|
|
1135
1116
|
if (!Array.isArray(parsed)) throw new Refusal("invalid-input", `The batch ${path} is not a JSON list of writes. Give a list such as [{"op": "rename", "address": "$2100", "name": "update_player"}].`);
|
|
1136
1117
|
const operations = parsed.map((item, index) => batchOperation(call, item, `write ${index + 1}`));
|
|
1137
|
-
return (db) =>
|
|
1138
|
-
const applied = applyBatch(db, { ...context, image: operandImages(db) }, operations);
|
|
1139
|
-
// replaced: each write that replaced a row of another origin, with that row as previous gives it for one write.
|
|
1140
|
-
const replaced = applied.steps.flatMap((step, index) => (step.previous === undefined ? [] : [{ write: index + 1, op: operations[index]!.op, previous: shownPrevious(step.previous) }]));
|
|
1141
|
-
return { revision: applied.revision, writes: applied.steps.length, replaced };
|
|
1142
|
-
};
|
|
1118
|
+
return (db) => applied(db, context, operations);
|
|
1143
1119
|
},
|
|
1144
1120
|
),
|
|
1145
1121
|
];
|
|
1146
1122
|
|
|
1147
|
-
/**
|
|
1123
|
+
/** Applies the writes of a batch as one revision, and gives the revision, the count and each row of another origin that a write replaced. */
|
|
1124
|
+
function applied(db: DatabaseSync, context: WriteContext, operations: BatchOperation[]) {
|
|
1125
|
+
const result = applyBatch(db, { ...context, image: operandImages(db) }, operations);
|
|
1126
|
+
// replaced: each write that replaced a row of another origin, with that row as previous gives it for one write.
|
|
1127
|
+
const replaced = result.steps.flatMap((step, index) => (step.previous === undefined ? [] : [{ write: index + 1, op: operations[index]!.op, previous: shownPrevious(step.previous) }]));
|
|
1128
|
+
return { revision: result.revision, writes: result.steps.length, replaced };
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/** join: the batches of agents that worked in parallel, as one list of writes. With --apply, it writes them as one revision. */
|
|
1148
1132
|
const JOIN: CommandSpec = {
|
|
1149
1133
|
name: "join",
|
|
1150
|
-
summary: "Joins the batches of agents that worked in parallel into one
|
|
1134
|
+
summary: "Joins the batches of agents that worked in parallel into one list of writes, and shows it. With --apply, it writes the list as one revision, or nothing when one write is refused.",
|
|
1151
1135
|
subjects: [{ name: "<batch>", help: 'a batch: a list of writes, or {"owner": {"start": "$1000", "end": "$1fff"}, "ops": [...]}', list: true }],
|
|
1152
|
-
options: { ...
|
|
1136
|
+
options: { ...WRITE, apply: { kind: "flag", help: "write the joined writes to the project knowledge as one revision. Without it, the result only shows them" }, ...LIST },
|
|
1153
1137
|
notes: "At an address in the owner range of a batch, its name, comment, operand and module win, and its regions come last. One name or one module file at two addresses writes nothing.",
|
|
1154
1138
|
run: (call) => {
|
|
1155
1139
|
if (call.subjects.length < 2) throw new UsageError("join needs two or more batch files.");
|
|
@@ -1186,9 +1170,10 @@ const JOIN: CommandSpec = {
|
|
|
1186
1170
|
const clash = (item: JoinClash) => `${item.what} ${item.value} at ${item.places.map((place) => `${formatC64Address(place.address)} (${place.file})`).join(" and ")}${item.space === DEFAULT_SPACE ? "" : ` in ${item.space}`}`;
|
|
1187
1171
|
throw new Refusal("conflict", `The batches give one ${joined.clashes.map(clash).join(", one ")}. Nothing was written. Give each name and each module file one address in the batches, then join again.`);
|
|
1188
1172
|
}
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1173
|
+
const shown = { repeated: joined.repeated, choices: joined.choices.map(choice) };
|
|
1174
|
+
if (call.flag("apply")) return { ...withWrite((db) => applied(db, contextOf(call), joined.ops)), ...shown };
|
|
1175
|
+
const body = { writes: listed(joined.ops.map(batchJson), call.count("max-listed")!, (write) => write, MORE), ...shown };
|
|
1176
|
+
return reply(body, { hint: "Examine each item of choices and writes. Then nextAction writes them to the project knowledge as one revision.", nextAction: call.next("join", ...call.subjects, "--apply") });
|
|
1192
1177
|
},
|
|
1193
1178
|
};
|
|
1194
1179
|
|
|
@@ -34,7 +34,7 @@ To get the command list, run the script with no arguments.
|
|
|
34
34
|
| Save a module of the program as a routine of the library | `routine '$1000' --library ../library` |
|
|
35
35
|
| Save a range of the program as a routine with a name | `routine '$1000-$1026' --name play --library ../library` |
|
|
36
36
|
| Find the routines of the library in the program | `match --library ../library` |
|
|
37
|
-
| Write the names of the found routines
|
|
37
|
+
| Write the names of the found routines to the project knowledge | `match --library ../library --apply` |
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -86,7 +86,8 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
86
86
|
| `--min-block <n>` | `compare` | With `--align`: the minimum number of bytes in a block, from 8. The default is 16. |
|
|
87
87
|
| `--frames <n>` | `compare` | Run each release for `n` frames, and give each listed difference its runtime evidence. The default is no run. |
|
|
88
88
|
| `--steps <file>` | `compare` | With `--frames`: run the action steps of this file before the frames. The default is no steps. |
|
|
89
|
-
| `--out <file>` | `separate`, `leftovers
|
|
89
|
+
| `--out <file>` | `separate`, `leftovers` | Write all items to this file. The default is no file. |
|
|
90
|
+
| `--apply` | `match` | Write the changes to the project knowledge as one revision of the LLM. Without it, `match` writes nothing. |
|
|
90
91
|
| `--max-listed <n>` | `separate`, `leftovers`, `match` | List at most `n` items of each list. The default is 50. `count` always gives the full number. |
|
|
91
92
|
| `--min-text <n>` | `leftovers` | The minimum number of characters in a text, from 4. The default is 8. A short text, for example a group name, can need 6. |
|
|
92
93
|
| `--library <folder>` | `routine`, `match` | Required. The library folder. |
|
|
@@ -265,9 +266,9 @@ Finds each routine of the library in the program of the project knowledge.
|
|
|
265
266
|
- `library` and `routines`: the library folder and the number of routines in it.
|
|
266
267
|
- `matches`: each item has `routine`, `start`, `end` and `shift`. `shift` is the address in the program minus the address in the library.
|
|
267
268
|
- `differing` in each match: each operand that addresses something outside the routine and that is different. It gives the value in the `library` and in the `program`. Examine each one. For example, the program can use other variables or another SID voice.
|
|
268
|
-
- `
|
|
269
|
+
- `changes`: with matches. `writes` lists the writes for the project knowledge. `known` counts the writes that the project knowledge has already. `leftOut` lists the writes that the script left out, and why. `check` lists each comment of `writes` that gives an address outside its routine. Each item has `routine`, `address`, `comment` and the `outside` addresses. Such an address can be different in this program. With `--apply`, `revision` gives the revision of the changes.
|
|
269
270
|
|
|
270
|
-
The
|
|
271
|
+
The changes have the names, regions, comments, references and operand expressions of each routine at its address in the program. The script leaves out a write in these conditions:
|
|
271
272
|
|
|
272
273
|
- The program has a user or LLM row at that place.
|
|
273
274
|
- The program uses the name at another address.
|
|
@@ -275,14 +276,14 @@ The batch has the names, regions, comments, references and operand expressions o
|
|
|
275
276
|
- The routine occurs more than one time, and the script did not choose this copy.
|
|
276
277
|
- The script left out the name that an operand expression uses, or the expression does not give the operand in the program.
|
|
277
278
|
|
|
278
|
-
A routine can occur more than one time. Then the script finds the nearest routines before and after it in the library that occur only one time. The script writes the names at the copy that has the shift of one of these routines. If no copy or more than one copy has such a shift, the script writes no names for the routine. Then `
|
|
279
|
+
A routine can occur more than one time. Then the script finds the nearest routines before and after it in the library that occur only one time. The script writes the names at the copy that has the shift of one of these routines. If no copy or more than one copy has such a shift, the script writes no names for the routine. Then `changes.leftOut` gives each copy with the reason `ambiguous`.
|
|
279
280
|
|
|
280
|
-
An address `$xxxx` in a comment moves with the routine when the address is in the routine. An address outside the routine does not move, and `
|
|
281
|
+
An address `$xxxx` in a comment moves with the routine when the address is in the routine. An address outside the routine does not move, and `changes.check` gives the comment.
|
|
281
282
|
|
|
282
283
|
`hint` and `nextAction`:
|
|
283
284
|
|
|
284
|
-
- Without `--
|
|
285
|
-
-
|
|
285
|
+
- Without `--apply`, with writes: `nextAction` runs `match` with `--apply`. Examine `differing` of each match, `changes.writes` and `changes.leftOut` first.
|
|
286
|
+
- When `changes.check` has comments, `hint` tells you to examine them after the write. Correct each comment that is different in the project knowledge.
|
|
286
287
|
- No match: `hint` tells that a packed program can hold a routine in a packed form. Unpack the program, put it into the project knowledge, and run `match` again.
|
|
287
288
|
|
|
288
289
|
Traps:
|
|
@@ -333,8 +334,8 @@ Traps:
|
|
|
333
334
|
1. Put the program into the project knowledge, and name the routine there.
|
|
334
335
|
2. Run `routine`. Read `leftOut`.
|
|
335
336
|
3. In another project, put the program into the project knowledge. Run `match`.
|
|
336
|
-
4.
|
|
337
|
-
5.
|
|
337
|
+
4. Read `changes.writes` and `changes.leftOut`. Run `match` with `--apply`.
|
|
338
|
+
5. Examine the comments in `changes.check`. Correct each comment that is different in the project knowledge.
|
|
338
339
|
|
|
339
340
|
---
|
|
340
341
|
|