@henols/c64-re-tools 2.1.8 → 2.2.0-rc.1
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 +4 -2
- package/skills/c64-assembler/scripts/assembler.ts +24 -12
- package/skills/c64-docs/references/page-types.md +1 -1
- package/skills/c64-knowledge/SKILL.md +66 -13
- package/skills/c64-knowledge/scripts/knowledge.ts +165 -18
- package/skills/c64-provenance/SKILL.md +11 -3
- package/skills/c64-reverse-engineering/SKILL.md +28 -13
- package/skills/c64-source/SKILL.md +33 -13
- package/skills/c64-source/scripts/lib/loader.ts +3 -1
- package/skills/c64-source/scripts/lib/source.ts +151 -37
- package/skills/c64-source/scripts/source.ts +135 -45
- package/skills/c64-unpacker/SKILL.md +4 -1
- package/src/knowledge/conflicts.ts +32 -8
- package/src/knowledge/history.ts +18 -0
- package/src/knowledge/read.ts +98 -4
- package/src/knowledge/schema.ts +43 -2
- package/src/knowledge/text.ts +22 -0
- package/src/knowledge/write.ts +248 -25
package/package.json
CHANGED
|
@@ -31,7 +31,8 @@ node <skill>/scripts/assembler.ts build src main.a --out build/game.prg
|
|
|
31
31
|
| `--include lib` | An include directory, relative to the source root. Use it again for more directories. |
|
|
32
32
|
| `--define DEBUG=1` | An assembler symbol: an integer, also as `$` hex, or `true` or `false`. Use it again for more symbols. |
|
|
33
33
|
| `--set-pc '$0801'` | The start address when the source does not set one. |
|
|
34
|
-
| `--
|
|
34
|
+
| `--release ORIGINAL` | Build a release of the knowledge. The script defines `RELEASE_ORIGINAL=1`, so each switch has the value of that release. With `--compare`, the script compares with the file of the release. A `--define` of a switch overrides the release. |
|
|
35
|
+
| `--compare` | Check the program byte by byte against the program in the knowledge, each segment. Put it in with `image` of the c64-knowledge skill. `--space drive8` or `--space bank0` compares with the program of that space. The script refuses `--space` without `--compare` or `--release`. |
|
|
35
36
|
| `--plain` | Write only the bytes of the program, without the 2-byte load address of a PRG. `loadRange` still tells where the bytes go. |
|
|
36
37
|
| `--all-symbols` | List all symbols. Without it, the list does not include the constants that the source does not use. `unusedConstants` gives their count. |
|
|
37
38
|
| `--max-listed 200` | Show at most 200 symbols in the result. The default is 50. `symbols.count` gives the count of all symbols. |
|
|
@@ -74,7 +75,7 @@ The target CPU is the 6510. The output is a C64 PRG, or the bytes only with `--p
|
|
|
74
75
|
4. If `result` is `FAIL` and `assembled` is `false`, read `diagnostics`. Each one has a severity, a file, a line and a message. Correct the source and run the script again.
|
|
75
76
|
5. To run the program, give the PRG path to the c64-emulator skill.
|
|
76
77
|
|
|
77
|
-
The source of the c64-source skill has switches.
|
|
78
|
+
The source of the c64-source skill has switches in `switches.asm`. Without an option, the build is the default build: the clean program without copy protection, trainers, cheats and crack changes, and with all corrections. This build can differ from the program in the knowledge, so `--compare` can give `FAIL`. Use `--release <label> --compare` to check the build of a release. `--define TRAINER=1` puts in the patches of the switch `TRAINER`.
|
|
78
79
|
|
|
79
80
|
## Knowledge
|
|
80
81
|
|
|
@@ -94,6 +95,7 @@ A symbol from the rebuilt source can give the address of a routine in the rebuil
|
|
|
94
95
|
- `PASS`: the PRG is in the project at `out`, with its load range and symbols.
|
|
95
96
|
- `FAIL` with `assembled: false`: the source has errors. `diagnostics` gives them.
|
|
96
97
|
- `FAIL` with `assembled: true`: `--compare` found differences. The PRG is at `out`.
|
|
98
|
+
- `not-found` with `--release`: the knowledge has no release with that label. The c64-knowledge skill records releases.
|
|
97
99
|
|
|
98
100
|
With `--compare`, `compare` gives `identical` and `segments`: one check for each segment of the program in the knowledge. The `result` of a check is `identical`, `different` with `firstDifference`, or `not covered` when the build does not hold the segment. `firstDifference` gives the `address`, and the byte of the build (`built`) and of the knowledge (`reference`), each as `$` and two hex digits.
|
|
99
101
|
|
|
@@ -5,15 +5,18 @@ import { posix } from "node:path";
|
|
|
5
5
|
|
|
6
6
|
import { formatC64Address } from "#src/c64.ts";
|
|
7
7
|
import { Refusal } from "#src/errors.ts";
|
|
8
|
+
import { readImage } from "#src/host-client/image.ts";
|
|
8
9
|
import { readProjectTree, writeReported } from "#src/host-client/transfer.ts";
|
|
9
10
|
import { openForRead } from "#src/knowledge/database.ts";
|
|
10
11
|
import { knowledgeNames } from "#src/knowledge/names.ts";
|
|
11
|
-
import { requireProgram
|
|
12
|
+
import { requireProgram } from "#src/knowledge/program.ts";
|
|
13
|
+
import { releaseLabeled } from "#src/knowledge/read.ts";
|
|
14
|
+
import { RELEASE_DEFINE } from "#src/knowledge/schema.ts";
|
|
12
15
|
import { assemble } from "#src/native/acme.ts";
|
|
13
16
|
import { localToolContext } from "#src/native/local.ts";
|
|
14
17
|
import type { AcmeParams, AssembledSymbol } from "#src/native/types.ts";
|
|
15
18
|
import { listed as listedItems, OPTIONS, runScript, UsageError } from "#src/script.ts";
|
|
16
|
-
import { compareBuild } from "./lib/compare.ts";
|
|
19
|
+
import { compareBuild, type Reference } from "./lib/compare.ts";
|
|
17
20
|
|
|
18
21
|
function parseDefine(text: string): [string, number | boolean] {
|
|
19
22
|
const match = /^([A-Za-z_][A-Za-z0-9_]*)=(.+)$/.exec(text);
|
|
@@ -39,7 +42,7 @@ await runScript({
|
|
|
39
42
|
commands: [
|
|
40
43
|
{
|
|
41
44
|
name: "build",
|
|
42
|
-
summary: "Assembles the source and writes the program. result is PASS when it assembles (and with --compare, when it is the program of the knowledge), else FAIL with the diagnostics or the differences.",
|
|
45
|
+
summary: "Assembles the source and writes the program. result is PASS when it assembles (and with --compare, when it is the program of the knowledge or of the --release), else FAIL with the diagnostics or the differences.",
|
|
43
46
|
subjects: [
|
|
44
47
|
{ name: "<source-root>", help: "the folder in the project to assemble from: all of it is sent" },
|
|
45
48
|
{ name: "<entry>", help: "the main source file, relative to the source root" },
|
|
@@ -49,24 +52,33 @@ await runScript({
|
|
|
49
52
|
include: { kind: "text", value: "<dir>", multiple: true, help: "an include folder, relative to the source root" },
|
|
50
53
|
define: { kind: "text", value: "NAME=VALUE", multiple: true, help: "an assembler symbol: an integer ($hex allowed) or true/false" },
|
|
51
54
|
"set-pc": { kind: "address", value: "<address>", help: "the start address when the source sets none, for example '$0801'" },
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
release: { kind: "text", value: "<label>", help: `build a release of the knowledge: defines ${RELEASE_DEFINE}<label>=1, so each switch has the value of that release. With --compare, the reference is the file of the release` },
|
|
56
|
+
compare: { kind: "flag", help: "check the program byte by byte against the program in the knowledge (or the file of --release), each segment" },
|
|
57
|
+
space: { kind: "space", value: "<space>", help: "with --compare or --release: the knowledge space of the program: c64 (the default), drive8, or bank0 to bank255" },
|
|
54
58
|
plain: { kind: "flag", help: "write the bytes only, without the 2-byte load address of a PRG" },
|
|
55
59
|
"all-symbols": { kind: "flag", help: "list also the constants that the source does not use" },
|
|
56
60
|
"max-listed": { ...OPTIONS["max-listed"], help: "list at most n symbols (default 50). The count is always given" },
|
|
57
61
|
"out-symbols": { kind: "path", output: "file", value: "<file.json>", help: "write the listed symbols to this project file as {\"symbols\": [...]}: the names of the rebuild for c64-testing. Without --all-symbols, the file does not have the constants that the source does not use" },
|
|
58
62
|
},
|
|
59
|
-
notes: "Symbol values are $ and at least four hex digits. Put the program into the knowledge with knowledge.ts image of the c64-knowledge skill before --compare.",
|
|
63
|
+
notes: "Symbol values are $ and at least four hex digits. Put the program into the knowledge with knowledge.ts image of the c64-knowledge skill before --compare. Without --release and --define, the build is the default build of switches.asm: the clean program, which is not the bytes of a release when a switch has a default that the base release does not have.",
|
|
60
64
|
run: async (call) => {
|
|
61
65
|
const [sourceRoot, entry] = [call.subject(0), call.subject(1)];
|
|
62
66
|
const out = call.string("out")!;
|
|
63
|
-
// Read the
|
|
64
|
-
let program:
|
|
65
|
-
|
|
66
|
-
if (call.flag("compare"))
|
|
67
|
+
// Read the reference before ACME runs, so a project without it stops at once.
|
|
68
|
+
let program: Reference | undefined;
|
|
69
|
+
const label = call.string("release");
|
|
70
|
+
if (call.string("space") !== undefined && !call.flag("compare") && label === undefined) throw new UsageError("--space works only with --compare or --release: it names the knowledge space of the program");
|
|
71
|
+
let releaseDefine: Record<string, number> = {};
|
|
72
|
+
if (call.flag("compare") || label !== undefined) {
|
|
67
73
|
const db = openForRead();
|
|
68
74
|
try {
|
|
69
|
-
program = requireProgram(db, call.space);
|
|
75
|
+
if (label === undefined) program = requireProgram(db, call.space);
|
|
76
|
+
else {
|
|
77
|
+
const release = releaseLabeled(db, label, call.space);
|
|
78
|
+
if (release === undefined) throw new Refusal("not-found", `There is no release ${label} in the knowledge. Record it with knowledge.ts release of the c64-knowledge skill.`);
|
|
79
|
+
releaseDefine = { [`${RELEASE_DEFINE}${label}`]: 1 };
|
|
80
|
+
if (call.flag("compare")) program = release.base ? requireProgram(db, call.space) : readImage(release.file);
|
|
81
|
+
}
|
|
70
82
|
} finally {
|
|
71
83
|
db?.close();
|
|
72
84
|
}
|
|
@@ -82,7 +94,7 @@ await runScript({
|
|
|
82
94
|
throw new Refusal("not-found", `There is no include folder ${folder} with files in the source root ${sourceRoot}. Give --include a folder relative to the source root.`);
|
|
83
95
|
}
|
|
84
96
|
}
|
|
85
|
-
const params: AcmeParams = { files: tree.files, entrySource: entry, includeDirs: call.strings("include"), defines: Object.fromEntries(call.strings("define").map(parseDefine)), ...(setPc === undefined ? {} : { setPc }) };
|
|
97
|
+
const params: AcmeParams = { files: tree.files, entrySource: entry, includeDirs: call.strings("include"), defines: { ...releaseDefine, ...Object.fromEntries(call.strings("define").map(parseDefine)) }, ...(setPc === undefined ? {} : { setPc }) };
|
|
86
98
|
|
|
87
99
|
const { result, attachments } = await assemble(params, tree.contents, localToolContext());
|
|
88
100
|
if (!result.assembled) return { result: "FAIL", assembled: false, diagnostics: result.diagnostics };
|
|
@@ -13,7 +13,7 @@ One entry page for the program: `README.md` in the project folder. A large subsy
|
|
|
13
13
|
5. **Findings.** A table of the facts that a reader does not expect, each with its evidence. Put a bug of the original program here.
|
|
14
14
|
6. **The reference.** A link to `docs/reference/index.md`.
|
|
15
15
|
7. **Still open.** What is not known yet, and which run can find it.
|
|
16
|
-
8. **The
|
|
16
|
+
8. **The releases and the rebuild.** What each release holds, for example a crack with a cracktro and a mover. Which release is the base release, the program of the knowledge. Which changes of the release to the machine state stay, and how the loader sets them. A table of the switches from `knowledge.ts switches`: the name, the kind, the default and the releases that have the switch on. How to build the default program and each release. Which scenarios compare the original with the rebuild.
|
|
17
17
|
|
|
18
18
|
```markdown
|
|
19
19
|
# <Program>: <subject>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: c64-knowledge
|
|
3
|
-
description: Use this skill to read, write, correct and review the durable knowledge of a C64 project in .c64-re-tools/knowledge/. The knowledge holds the program, its entry state and the coverage of the runs. It gives the knowledge at an address, and it names symbols, classifies memory regions, sets comments and records references. It records patches and macros for the generated source. It also shows the history of each change, and it can revert to an earlier revision. Do not use it for live emulator state or for static analysis.
|
|
3
|
+
description: Use this skill to read, write, correct and review the durable knowledge of a C64 project in .c64-re-tools/knowledge/. The knowledge holds the program, its entry state and the coverage of the runs. It gives the knowledge at an address, and it names symbols, classifies memory regions, sets comments and records references. It records releases, switches, patches and macros for the generated source. It also shows the history of each change, and it can revert to an earlier revision. Do not use it for live emulator state or for static analysis.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# c64-knowledge
|
|
@@ -55,14 +55,16 @@ A symbol is the name of an address from the user or the LLM. An analyzer name is
|
|
|
55
55
|
| Start a file of generated source | `module '$2000' player.asm --title 'Player movement'` / `unmodule '$2000'` |
|
|
56
56
|
| Write the operand of an instruction as an expression | `operand '$8079' --lo irq_handler` / `unoperand '$8079'` |
|
|
57
57
|
| Operand expressions | `operands` with `--range` |
|
|
58
|
-
|
|
|
59
|
-
|
|
|
58
|
+
| Record a release of the program | `release ORIGINAL --file original/game.prg --base` / `unrelease V2` |
|
|
59
|
+
| Write a switch | `switch PROTECTION --kind protection --releases ORIGINAL` / `unswitch PROTECTION` |
|
|
60
|
+
| Write the code of a switch for a range | `patch '$100e-$1010' PROTECTION --code-file no-check.asm` / `unpatch '$100e'` |
|
|
61
|
+
| Releases, switches and patches | `releases`, `switches`, and `patches` with `--switch` |
|
|
60
62
|
| Write a macro | `macro inc16 --params dst --body-file inc16.asm` / `unmacro inc16` |
|
|
61
63
|
| Write instructions as one use of a macro | `use '$1005-$100a' inc16 --args ptr` / `unuse '$1005'` |
|
|
62
64
|
| Macros and their uses | `macros`, and `uses` with `--range` and `--macro` |
|
|
63
65
|
| Files of generated source | `modules` |
|
|
64
66
|
| The address spaces that hold knowledge | `spaces` |
|
|
65
|
-
| History | `history '$2100'`, `history --name update_player`, `history --macro inc16`, `revisions`, `revision 20261015T2145` |
|
|
67
|
+
| History | `history '$2100'`, `history --name update_player`, `history --macro inc16`, `history --switch PROTECTION`, `revisions`, `revision 20261015T2145` |
|
|
66
68
|
| Go back to an earlier state | `revert 20261015T2145` for all spaces, or `revert 20261015T2145 --space bank3` for one space |
|
|
67
69
|
| Decide the conflicts after a git merge | `merge --reason 'merge of two computers'` |
|
|
68
70
|
|
|
@@ -173,7 +175,8 @@ The ops and their fields:
|
|
|
173
175
|
| `operand` | `address`, `select` (`lo`, `hi`, `value` or `expr`), `symbol` and `offset` (optional), or `expression` for `expr` |
|
|
174
176
|
| `unoperand` | `address` |
|
|
175
177
|
| `patch` | `start`, `end`, `switch`, `code` (empty for NOP only), `comment` (optional) |
|
|
176
|
-
| `unpatch
|
|
178
|
+
| `unpatch` | `start`, `switch` (optional) |
|
|
179
|
+
| `unuse` | `start` |
|
|
177
180
|
| `macro` | `name`, `params` (a list or a comma list), `body`, `comment` (optional) |
|
|
178
181
|
| `unmacro` | `name` |
|
|
179
182
|
| `use` | `start`, `end`, `macro`, `args` (a list or a comma list) |
|
|
@@ -205,7 +208,7 @@ Then apply the joined batch with the command in `apply`.
|
|
|
205
208
|
|
|
206
209
|
## Modules
|
|
207
210
|
|
|
208
|
-
A module tells the c64-source skill where a file of the generated source starts. The file runs to the next module or to the end of its segment. Each address has one module, and each file name has one module. A file name has letters, digits, underscores or hyphens, and ends in `.asm`. The c64-source skill writes `main.asm`, `loader.asm`, `constants.asm` and `macros.asm` itself. Thus a module cannot have one of these names, in upper or lower case. The title becomes the first line of the file. A `module` write without a title keeps the title that the module has. Modules have a history, and `revert` restores them.
|
|
211
|
+
A module tells the c64-source skill where a file of the generated source starts. The file runs to the next module or to the end of its segment. Each address has one module, and each file name has one module. A file name has letters, digits, underscores or hyphens, and ends in `.asm`. The c64-source skill writes `main.asm`, `loader.asm`, `switches.asm`, `constants.asm` and `macros.asm` itself. Thus a module cannot have one of these names, in upper or lower case. The title becomes the first line of the file. A `module` write without a title keeps the title that the module has. Modules have a history, and `revert` restores them.
|
|
209
212
|
|
|
210
213
|
## Operand expressions
|
|
211
214
|
|
|
@@ -230,21 +233,71 @@ Give one selector:
|
|
|
230
233
|
|
|
231
234
|
Write an operand expression for each immediate that is a byte of an address. Also write one for each table read through the byte before the table. The pointer candidates of the c64-static-analysis skill show many of these places.
|
|
232
235
|
|
|
233
|
-
##
|
|
236
|
+
## Releases and switches
|
|
234
237
|
|
|
235
|
-
A
|
|
238
|
+
A rebuild keeps all of the program. It keeps unused bytes, dead code, old copies and leftovers of the development. It keeps a copy protection, a trainer and a cheat in the source. A switch puts each of them in or out of the build. Only a cracktro is not in the rebuild: see the c64-unpacker skill.
|
|
236
239
|
|
|
237
|
-
|
|
238
|
-
|
|
240
|
+
### Releases
|
|
241
|
+
|
|
242
|
+
A release is a PRG or a c64-unpacker `image.json` of the program, in a folder that git keeps, for example `original/`. `release` records its label, its file and the SHA-256 of the file.
|
|
243
|
+
|
|
244
|
+
- 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.
|
|
245
|
+
- A space has one base release. Record the base release before the first switch.
|
|
246
|
+
- The build of a release defines `RELEASE_<label>=1`. Then each switch has the value of that release. The c64-source skill checks that this build gives the bytes of the file.
|
|
247
|
+
- A label is upper case, for example `ORIGINAL`, `FIRESTAR` or `V2`.
|
|
248
|
+
- `unrelease` refuses a release that a switch names. It also refuses the base release while the knowledge has switches.
|
|
249
|
+
|
|
250
|
+
### Switches
|
|
251
|
+
|
|
252
|
+
All switches are in `switches.jsonl` of the knowledge, and the c64-source skill writes all of them to `switches.asm`. A switch has a kind, a default and the releases that have it on.
|
|
253
|
+
|
|
254
|
+
| Kind | What it changes | Default |
|
|
255
|
+
|---|---|---|
|
|
256
|
+
| `protection` | A copy protection | 0 (off) |
|
|
257
|
+
| `trainer` | A trainer, for example infinite lives | 0 (off) |
|
|
258
|
+
| `cheat` | A cheat | 0 (off) |
|
|
259
|
+
| `crack` | A change that a cracker made in the program, for example a credit text | 0 (off) |
|
|
260
|
+
| `fix` | A correction that one or more releases have | 1 (on). Give `--default 0` only for an alternative (below). |
|
|
261
|
+
| `change` | Another difference between releases | Give `--default 0` or `--default 1` |
|
|
262
|
+
|
|
263
|
+
- The default build is the clean program. It has no copy protection, trainer, cheat or crack change, and it has all corrections. The script refuses `--default 1` for `protection`, `trainer`, `cheat` and `crack`.
|
|
264
|
+
- `--releases` lists the labels of the releases that have the switch on. A switch that no release has on, for example a trainer of your own, has no `--releases`.
|
|
265
|
+
- The base value of a switch is 1 when the base release has it on, else 0. The program of the knowledge has the base value of each switch.
|
|
266
|
+
- A switch name is upper case, for example `PROTECTION`, `TRAINER` or `FIX_LIVES`. It cannot start with `RELEASE_`. It cannot be the name of a symbol or a platform name.
|
|
267
|
+
- A `switch` write without `--releases` or `--comment` keeps the releases and the comment that the switch has.
|
|
268
|
+
- The script refuses a change of the base value while the switch has patches. Remove the patches first, because they hold the other state.
|
|
269
|
+
- `unswitch` refuses a switch that has patches.
|
|
270
|
+
- `switches` gives each switch with `default`, `base`, `releases`, its patches, and the defines `on` and `off`. `releases` gives each release with its define.
|
|
271
|
+
|
|
272
|
+
### Patches
|
|
273
|
+
|
|
274
|
+
A patch is ACME code for a range of the program. The code is the bytes of the switch in the state that the base release does not have. Examples:
|
|
275
|
+
|
|
276
|
+
- The base release has a copy protection. The switch `PROTECTION` names the base release. The code is the program without the protection, for example NOP in place of the `JSR` to the check.
|
|
277
|
+
- The base release has the protection already removed, and another release has it: the code is the bytes of the protection from that release. When no release has these bytes, record in a comment that the crack removed the protection.
|
|
278
|
+
- A correction is only in release `V2`: the switch `FIX_LIVES` names `V2`, and the code is the bytes of `V2`.
|
|
279
|
+
- A correction is in the base release and not in `V1`. The switch names the base release, and the code is the bytes of `V1`.
|
|
280
|
+
|
|
281
|
+
Rules:
|
|
282
|
+
|
|
283
|
+
- Write the switch first. `patch` refuses a switch that the knowledge does not have.
|
|
284
|
+
- Many patches can have the same switch.
|
|
239
285
|
- The code must fit in the range. NOP ($EA) fills the bytes after the code. `--nop` gives a range of NOP only.
|
|
240
|
-
- `patch` refuses code that is longer than the range when each line is a 6510 instruction, `!byte`, `!word`, `!fill` or a comment. `patch` does not check the length of other code, for example code with a label or a macro. It does not assemble the code. `generate` of the c64-source skill
|
|
286
|
+
- `patch` refuses code that is longer than the range when each line is a 6510 instruction, `!byte`, `!word`, `!fill` or a comment. `patch` does not check the length of other code, for example code with a label or a macro. It does not assemble the code. `generate` of the c64-source skill does these checks.
|
|
241
287
|
- `--code` gives the code as text. `--code-file` reads the code from a project file. The code can use the labels and the macros of the source, and local labels with a dot, for example `.skip`.
|
|
242
288
|
- The braces in the code must be pairs, because the source puts the code inside `{ }`.
|
|
243
|
-
-
|
|
289
|
+
- Patches of different switches can have the same range. They are alternatives, for example two releases with two different corrections of one bug. The default build can put in only one of them. Thus `switch` refuses defaults that put in two alternatives.
|
|
290
|
+
- The knowledge refuses all other overlaps of patches. A patch cannot overlap a macro use.
|
|
291
|
+
- A patch with the same start and the same switch replaces the patch.
|
|
292
|
+
- When patches of two switches start at one address, give `unpatch` the switch with `--switch`.
|
|
244
293
|
- Each byte of the range must be in the program of the knowledge.
|
|
245
294
|
- A `patch` write without `--comment` keeps the comment that the patch has.
|
|
246
295
|
|
|
247
|
-
Build
|
|
296
|
+
Build with the c64-assembler skill:
|
|
297
|
+
|
|
298
|
+
- The default build has no options.
|
|
299
|
+
- A release: `--release ORIGINAL`.
|
|
300
|
+
- One switch: `--define TRAINER=1`. A define overrides the release.
|
|
248
301
|
|
|
249
302
|
## Macros
|
|
250
303
|
|
|
@@ -14,13 +14,14 @@ import { readProjectFile, writeReported } from "#src/host-client/transfer.ts";
|
|
|
14
14
|
import { CONFLICT_RULES, conflicts, type Conflict } from "#src/knowledge/conflicts.ts";
|
|
15
15
|
import { openForRead, withWrite } from "#src/knowledge/database.ts";
|
|
16
16
|
import { operandText } from "#src/knowledge/expression.ts";
|
|
17
|
-
import { historyAt, historyNamed, historyOfMacro, revision, revisionNote, revisions, type HistoryEntry } from "#src/knowledge/history.ts";
|
|
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
20
|
import { addCoverage, programCoverage, programImage, requireProgram, setImage, type ImageRequest } from "#src/knowledge/program.ts";
|
|
21
21
|
import {
|
|
22
22
|
analyzerNamesAt,
|
|
23
23
|
at,
|
|
24
|
+
baseValue,
|
|
24
25
|
commentsAt,
|
|
25
26
|
coverageRuns,
|
|
26
27
|
currentRevision,
|
|
@@ -33,7 +34,9 @@ import {
|
|
|
33
34
|
listPatches,
|
|
34
35
|
listReferences,
|
|
35
36
|
listRegions,
|
|
37
|
+
listReleases,
|
|
36
38
|
listSpaces,
|
|
39
|
+
listSwitches,
|
|
37
40
|
listSuppressions,
|
|
38
41
|
listSymbols,
|
|
39
42
|
operandAt,
|
|
@@ -49,10 +52,12 @@ import {
|
|
|
49
52
|
type PatchRow,
|
|
50
53
|
type ReferenceRow,
|
|
51
54
|
type RegionRow,
|
|
55
|
+
type ReleaseRow,
|
|
52
56
|
type SuppressionRow,
|
|
57
|
+
type SwitchRow,
|
|
53
58
|
type SymbolRow,
|
|
54
59
|
} from "#src/knowledge/read.ts";
|
|
55
|
-
import { ANALYZERS, COMMENT_PLACEMENTS, DEFAULT_SPACE, EVIDENCE_KINDS, isSemantic, OPERAND_SELECTS, ORIGINS, REFERENCE_KINDS, REGION_TYPES, SEMANTIC_ORIGINS, SYMBOL_KINDS, type Origin, type OperandSelect } from "#src/knowledge/schema.ts";
|
|
60
|
+
import { ANALYZERS, COMMENT_PLACEMENTS, DEFAULT_SPACE, EVIDENCE_KINDS, isSemantic, OPERAND_SELECTS, ORIGINS, REFERENCE_KINDS, REGION_TYPES, RELEASE_DEFINE, SEMANTIC_ORIGINS, SWITCH_KINDS, SYMBOL_KINDS, type Origin, type OperandSelect, type SwitchKind } from "#src/knowledge/schema.ts";
|
|
56
61
|
import {
|
|
57
62
|
addReference,
|
|
58
63
|
applyBatch,
|
|
@@ -65,6 +70,8 @@ import {
|
|
|
65
70
|
removeOperand,
|
|
66
71
|
removePatch,
|
|
67
72
|
removeReference,
|
|
73
|
+
removeRelease,
|
|
74
|
+
removeSwitch,
|
|
68
75
|
removeSymbol,
|
|
69
76
|
renameSymbol,
|
|
70
77
|
revert,
|
|
@@ -74,6 +81,8 @@ import {
|
|
|
74
81
|
setModule,
|
|
75
82
|
setOperand,
|
|
76
83
|
setPatch,
|
|
84
|
+
setRelease,
|
|
85
|
+
setSwitch,
|
|
77
86
|
unclassifyRegion,
|
|
78
87
|
type BatchOperation,
|
|
79
88
|
type BatchStep,
|
|
@@ -129,6 +138,32 @@ const patch = (row: PatchRow) => ({
|
|
|
129
138
|
origin: row.origin,
|
|
130
139
|
revision: row.revision,
|
|
131
140
|
});
|
|
141
|
+
/** A switch with its value in the program (`base`), the defines that put it on or off, and its patches when they are given. */
|
|
142
|
+
const switchRow = (row: SwitchRow, base?: string, patches?: readonly PatchRow[]) => ({
|
|
143
|
+
...spaceOf(row),
|
|
144
|
+
name: row.name,
|
|
145
|
+
kind: row.kind,
|
|
146
|
+
default: row.default,
|
|
147
|
+
base: baseValue(row, base),
|
|
148
|
+
releases: row.releases,
|
|
149
|
+
on: `--define ${row.name}=1`,
|
|
150
|
+
off: `--define ${row.name}=0`,
|
|
151
|
+
...(row.comment === undefined ? {} : { comment: row.comment }),
|
|
152
|
+
...(patches === undefined ? {} : { patches: patches.map((patch) => ({ start: formatC64Address(patch.start), end: formatC64Address(patch.end) })) }),
|
|
153
|
+
origin: row.origin,
|
|
154
|
+
revision: row.revision,
|
|
155
|
+
});
|
|
156
|
+
const release = (row: ReleaseRow) => ({
|
|
157
|
+
...spaceOf(row),
|
|
158
|
+
label: row.label,
|
|
159
|
+
file: row.file,
|
|
160
|
+
sha256: row.sha256,
|
|
161
|
+
base: row.base,
|
|
162
|
+
define: `--define ${RELEASE_DEFINE}${row.label}=1`,
|
|
163
|
+
...(row.comment === undefined ? {} : { comment: row.comment }),
|
|
164
|
+
origin: row.origin,
|
|
165
|
+
revision: row.revision,
|
|
166
|
+
});
|
|
132
167
|
const macro = (row: MacroRow) => ({ ...spaceOf(row), name: row.name, params: row.params, body: row.body, ...(row.comment === undefined ? {} : { comment: row.comment }), origin: row.origin, revision: row.revision });
|
|
133
168
|
const macroUse = (row: MacroUseRow) => ({
|
|
134
169
|
...spaceOf(row),
|
|
@@ -176,6 +211,10 @@ function historyEntry(entry: HistoryEntry) {
|
|
|
176
211
|
? operand(entry.row)
|
|
177
212
|
: entry.entity === "patch"
|
|
178
213
|
? patch(entry.row)
|
|
214
|
+
: entry.entity === "switch"
|
|
215
|
+
? switchRow(entry.row)
|
|
216
|
+
: entry.entity === "release"
|
|
217
|
+
? release(entry.row)
|
|
179
218
|
: entry.entity === "macro"
|
|
180
219
|
? macro(entry.row)
|
|
181
220
|
: entry.entity === "macro-use"
|
|
@@ -348,7 +387,7 @@ const BATCH_FIELDS: Record<BatchOperation["op"], string[]> = {
|
|
|
348
387
|
operand: ["address", "select", "symbol", "offset", "expression"],
|
|
349
388
|
unoperand: ["address"],
|
|
350
389
|
patch: ["start", "end", "switch", "code", "comment"],
|
|
351
|
-
unpatch: ["start"],
|
|
390
|
+
unpatch: ["start", "switch"],
|
|
352
391
|
macro: ["name", "params", "body", "comment"],
|
|
353
392
|
unmacro: ["name"],
|
|
354
393
|
use: ["start", "end", "macro", "args"],
|
|
@@ -524,12 +563,15 @@ const READ_COMMANDS: CommandSpec[] = [
|
|
|
524
563
|
readCommand({ name: "patches", summary: "The code that a switch puts in.", options: { ...FILTER, switch: { kind: "text", value: "<switch>", help: "only the patches of this switch" }, ...LIST } }, (db, call) => ({
|
|
525
564
|
patches: list(call, listPatches(db, rangeOf(call), call.string("switch"), originsOf(call), call.space), patch, RANGE_REST),
|
|
526
565
|
})),
|
|
527
|
-
readCommand({ name: "switches", summary: "Each switch
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
const show = (
|
|
531
|
-
return { switches: list(call,
|
|
566
|
+
readCommand({ name: "switches", summary: "Each switch: its kind, its default, its value in the program (base), the releases that have it on and the ranges of its patches.", options: LIST }, (db, call) => {
|
|
567
|
+
const base = listReleases(db, undefined, call.space).find((row) => row.base)?.label;
|
|
568
|
+
const patches = listPatches(db, undefined, undefined, undefined, call.space);
|
|
569
|
+
const show = (row: SwitchRow) => switchRow(row, base, patches.filter((patch) => patch.switch === row.name));
|
|
570
|
+
return { switches: list(call, listSwitches(db, undefined, call.space), show, MORE) };
|
|
532
571
|
}),
|
|
572
|
+
readCommand({ name: "releases", summary: "The releases of the program, the base release first, each with the define that builds it.", options: LIST }, (db, call) => ({
|
|
573
|
+
releases: list(call, listReleases(db, undefined, call.space), release, MORE),
|
|
574
|
+
})),
|
|
533
575
|
readCommand({ name: "macros", summary: "The macros of the generated source.", options: { origin: OPTIONS.origin, ...LIST } }, (db, call) => ({ macros: list(call, listMacros(db, originsOf(call), call.space), macro, MORE) })),
|
|
534
576
|
readCommand({ name: "uses", summary: "The instructions written as a macro.", options: { ...FILTER, macro: { kind: "text", value: "<name>", help: "only the uses of this macro" }, ...LIST } }, (db, call) => ({
|
|
535
577
|
uses: list(call, listMacroUses(db, rangeOf(call), call.string("macro"), originsOf(call), call.space), macroUse, RANGE_REST),
|
|
@@ -558,14 +600,27 @@ const READ_COMMANDS: CommandSpec[] = [
|
|
|
558
600
|
name: "history",
|
|
559
601
|
summary: "The rows at an address, of a name or of a macro, through all revisions, each with the reason and the evidence of its revision.",
|
|
560
602
|
subjects: [{ ...ADDRESS, optional: true }],
|
|
561
|
-
options: {
|
|
562
|
-
|
|
603
|
+
options: {
|
|
604
|
+
name: { kind: "text", value: "<name>", help: "the history of a name in place of an address" },
|
|
605
|
+
macro: { kind: "text", value: "<name>", help: "the history of a macro in place of an address" },
|
|
606
|
+
switch: { kind: "text", value: "<name>", help: "the history of a switch and its patches in place of an address" },
|
|
607
|
+
...LIST,
|
|
608
|
+
},
|
|
609
|
+
notes: "Give exactly one of <address>, --name, --macro and --switch.",
|
|
563
610
|
},
|
|
564
611
|
(db, call) => {
|
|
565
612
|
const name = call.string("name");
|
|
566
613
|
const macroName = call.string("macro");
|
|
567
|
-
|
|
568
|
-
|
|
614
|
+
const switchName = call.string("switch");
|
|
615
|
+
if ([call.subjects.length > 0, name !== undefined, macroName !== undefined, switchName !== undefined].filter(Boolean).length !== 1) throw new UsageError("history needs exactly one of <address>, --name, --macro and --switch");
|
|
616
|
+
const entries =
|
|
617
|
+
switchName !== undefined
|
|
618
|
+
? historyOfSwitch(db, switchName, call.space)
|
|
619
|
+
: macroName !== undefined
|
|
620
|
+
? historyOfMacro(db, macroName, call.space)
|
|
621
|
+
: name !== undefined
|
|
622
|
+
? historyNamed(db, name, call.space)
|
|
623
|
+
: historyAt(db, call.parseAddress(call.subject(0), "<address>"), call.space);
|
|
569
624
|
return { history: list(call, entries, (entry) => ({ ...historyEntry(entry), ...revisionNote(db, entry.from) }), MORE) };
|
|
570
625
|
},
|
|
571
626
|
),
|
|
@@ -597,6 +652,8 @@ const READ_COMMANDS: CommandSpec[] = [
|
|
|
597
652
|
modules: listModules(db, range, origins, space).map(module),
|
|
598
653
|
operands: listOperands(db, range, origins, space).map(operand),
|
|
599
654
|
patches: listPatches(db, range, undefined, origins, space).map(patch),
|
|
655
|
+
switches: listSwitches(db, origins, space).map((row) => switchRow(row, listReleases(db, undefined, space).find((item) => item.base)?.label)),
|
|
656
|
+
releases: listReleases(db, origins, space).map(release),
|
|
600
657
|
macros: listMacros(db, origins, space).map(macro),
|
|
601
658
|
macroUses: listMacroUses(db, range, undefined, origins, space).map(macroUse),
|
|
602
659
|
};
|
|
@@ -739,15 +796,15 @@ const WRITE_COMMANDS: CommandSpec[] = [
|
|
|
739
796
|
writeCommand(
|
|
740
797
|
{
|
|
741
798
|
name: "patch",
|
|
742
|
-
summary: "ACME code
|
|
743
|
-
subjects: [RANGE, { name: "<switch>", help: "the switch
|
|
799
|
+
summary: "ACME code for a range of the program in the state of the switch that the base release does not have. NOP fills the rest of the range.",
|
|
800
|
+
subjects: [RANGE, { name: "<switch>", help: "the name of a switch of the knowledge" }],
|
|
744
801
|
options: {
|
|
745
802
|
code: { kind: "text", value: "<text>", help: "the ACME code" },
|
|
746
803
|
"code-file": { kind: "path", value: "<file>", help: "a project file with the ACME code" },
|
|
747
804
|
nop: { kind: "flag", help: "put only NOP" },
|
|
748
805
|
comment: { kind: "text", value: "<text>", help: "a comment for the patch" },
|
|
749
806
|
},
|
|
750
|
-
notes: "Give exactly one of --code, --code-file and --nop.",
|
|
807
|
+
notes: "Give exactly one of --code, --code-file and --nop. Write the switch first (switch). The program holds the bytes of the base release: when the base release has the switch on, the code is the bytes with the switch off. Another switch can have a patch at the same range, as an alternative.",
|
|
751
808
|
},
|
|
752
809
|
(call) => {
|
|
753
810
|
const context = contextOf(call);
|
|
@@ -758,10 +815,99 @@ const WRITE_COMMANDS: CommandSpec[] = [
|
|
|
758
815
|
return (db) => shown(setPatch(db, { ...context, image: operandImage(db, call.space) }, request), "patch", patch);
|
|
759
816
|
},
|
|
760
817
|
),
|
|
761
|
-
writeCommand(
|
|
818
|
+
writeCommand(
|
|
819
|
+
{
|
|
820
|
+
name: "unpatch",
|
|
821
|
+
summary: "Removes the patch that starts at an address.",
|
|
822
|
+
subjects: [START],
|
|
823
|
+
options: { switch: { kind: "text", value: "<switch>", help: "the switch of the patch, when patches of more than one switch start there" } },
|
|
824
|
+
},
|
|
825
|
+
(call) => {
|
|
826
|
+
const context = contextOf(call);
|
|
827
|
+
const switchName = call.string("switch");
|
|
828
|
+
const request = { space: call.space, start: call.parseAddress(call.subject(0), "<start>"), ...(switchName === undefined ? {} : { switch: switchName }) };
|
|
829
|
+
return (db) => ({ revision: removePatch(db, context, request).revision });
|
|
830
|
+
},
|
|
831
|
+
),
|
|
832
|
+
writeCommand(
|
|
833
|
+
{
|
|
834
|
+
name: "switch",
|
|
835
|
+
summary: "Writes a switch of the patches: what it changes, its default in the build, and the releases that have it on.",
|
|
836
|
+
subjects: [{ name: "<name>", help: "the switch name, for example PROTECTION or FIX_LIVES" }],
|
|
837
|
+
options: {
|
|
838
|
+
kind: { kind: "choice", value: "<kind>", choices: SWITCH_KINDS, help: `one of ${SWITCH_KINDS.join(", ")}`, required: true },
|
|
839
|
+
default: { kind: "choice", value: "<0|1>", choices: ["0", "1"], help: "the value in the default build. protection, trainer, cheat and crack are always 0; fix is 1 unless you give 0; change needs it" },
|
|
840
|
+
releases: { kind: "text", value: "<A,B>", help: "the labels of the releases that have the switch on, a comma list" },
|
|
841
|
+
comment: { kind: "text", value: "<text>", help: "what the switch changes" },
|
|
842
|
+
},
|
|
843
|
+
notes: "Record the base release first (release --base). A write keeps the releases and the comment that it does not give.",
|
|
844
|
+
},
|
|
845
|
+
(call) => {
|
|
846
|
+
const context = contextOf(call);
|
|
847
|
+
const given = call.string("default");
|
|
848
|
+
const releases = call.string("releases");
|
|
849
|
+
const commentText = call.string("comment");
|
|
850
|
+
const request = {
|
|
851
|
+
space: call.space,
|
|
852
|
+
name: call.subject(0),
|
|
853
|
+
kind: call.string("kind") as SwitchKind,
|
|
854
|
+
...(given === undefined ? {} : { default: given === "1" ? (1 as const) : (0 as const) }),
|
|
855
|
+
...(releases === undefined ? {} : { releases: commaList(releases) }),
|
|
856
|
+
...(commentText === undefined ? {} : { comment: commentText }),
|
|
857
|
+
};
|
|
858
|
+
return (db) => {
|
|
859
|
+
const result = setSwitch(db, { ...context, image: operandImage(db, call.space) }, request);
|
|
860
|
+
const base = listReleases(db, undefined, call.space).find((row) => row.base)?.label;
|
|
861
|
+
return shown(result, "switch", (row: SwitchRow) => switchRow(row, base));
|
|
862
|
+
};
|
|
863
|
+
},
|
|
864
|
+
),
|
|
865
|
+
writeCommand({ name: "unswitch", summary: "Removes a switch that has no patch.", subjects: [{ name: "<name>", help: "the switch name" }] }, (call) => {
|
|
762
866
|
const context = contextOf(call);
|
|
763
|
-
const request = { space: call.space,
|
|
764
|
-
return (db) => ({ revision:
|
|
867
|
+
const request = { space: call.space, name: call.subject(0) };
|
|
868
|
+
return (db) => ({ revision: removeSwitch(db, context, request).revision });
|
|
869
|
+
}),
|
|
870
|
+
writeCommand(
|
|
871
|
+
{
|
|
872
|
+
name: "release",
|
|
873
|
+
summary: "Records a release of the program: its PRG or c64-unpacker image.json in the project. The base release is the one whose bytes are the program of the knowledge.",
|
|
874
|
+
subjects: [{ name: "<label>", help: "the release label, for example ORIGINAL or FIRESTAR" }],
|
|
875
|
+
options: {
|
|
876
|
+
file: { kind: "path", value: "<file>", help: "the PRG or image.json of the release, in a folder that git keeps", required: true },
|
|
877
|
+
base: { kind: "flag", help: "this release is the program of the knowledge: its segments and bytes must be the same" },
|
|
878
|
+
comment: { kind: "text", value: "<text>", help: "what the release is, for example the group and the date" },
|
|
879
|
+
},
|
|
880
|
+
notes: "The build of a release defines RELEASE_<label>=1: each switch then has the value of that release. c64-source checks that this build gives the bytes of the file.",
|
|
881
|
+
},
|
|
882
|
+
(call) => {
|
|
883
|
+
const context = contextOf(call);
|
|
884
|
+
const file = knowledgePath(call.string("file")!, "--file");
|
|
885
|
+
const root = projectRoot();
|
|
886
|
+
if (isInside(join(root, PROJECT_DIRECTORY, LOCAL_DIRECTORY), resolveProjectPath(file, root))) {
|
|
887
|
+
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/`);
|
|
888
|
+
}
|
|
889
|
+
const image = readImage(file);
|
|
890
|
+
const sha256 = createHash("sha256").update(readProjectFile(file).bytes).digest("hex");
|
|
891
|
+
const commentText = call.string("comment");
|
|
892
|
+
const base = call.flag("base");
|
|
893
|
+
const request = { space: call.space, label: call.subject(0), file, sha256, ...(base ? { base } : {}), ...(commentText === undefined ? {} : { comment: commentText }) };
|
|
894
|
+
return (db) => {
|
|
895
|
+
if (base) {
|
|
896
|
+
const program = requireProgram(db, call.space);
|
|
897
|
+
const same = JSON.stringify(program.segments) === JSON.stringify(image.segments) && program.segments.every((segment) => {
|
|
898
|
+
for (let address = segment.start; address <= segment.end; address++) if (program.byteAt(address) !== image.byteAt(address)) return false;
|
|
899
|
+
return true;
|
|
900
|
+
});
|
|
901
|
+
if (!same) throw new Refusal("invalid-input", `The bytes of ${file} are not the program of the knowledge. The base release is the file that knowledge.ts image put in.`);
|
|
902
|
+
}
|
|
903
|
+
return shown(setRelease(db, context, request), "release", release);
|
|
904
|
+
};
|
|
905
|
+
},
|
|
906
|
+
),
|
|
907
|
+
writeCommand({ name: "unrelease", summary: "Removes a release that no switch names.", subjects: [{ name: "<label>", help: "the release label" }] }, (call) => {
|
|
908
|
+
const context = contextOf(call);
|
|
909
|
+
const request = { space: call.space, label: call.subject(0) };
|
|
910
|
+
return (db) => ({ revision: removeRelease(db, context, request).revision });
|
|
765
911
|
}),
|
|
766
912
|
writeCommand(
|
|
767
913
|
{
|
|
@@ -1012,6 +1158,7 @@ function batchFields(fields: Record<string, unknown>, at: string, address: (text
|
|
|
1012
1158
|
case "use":
|
|
1013
1159
|
return { op, start: place("start"), end: place("end"), macro: text("macro"), args: list("args") };
|
|
1014
1160
|
case "unpatch":
|
|
1161
|
+
return { op, start: place("start"), ...optional("switch") };
|
|
1015
1162
|
case "unuse":
|
|
1016
1163
|
return { op, start: place("start") };
|
|
1017
1164
|
case "reference":
|
|
@@ -88,7 +88,15 @@ With `--frames`, a PRG starts with autostart and RUN. An image starts from its b
|
|
|
88
88
|
- Disassemble the bytes of each release with the c64-emulator skill, or analyze them with the c64-static-analysis skill.
|
|
89
89
|
- Find what the change does, for example a trainer, a removed copy protection, or a changed text.
|
|
90
90
|
6. Decide which bytes are probably the original application. Use more than the byte comparison: the code, the text, and the history of the releases.
|
|
91
|
-
7. Record the
|
|
91
|
+
7. Record each release with `release` of the c64-knowledge skill. The base release is the program of the knowledge.
|
|
92
|
+
8. Record each difference as a switch and a patch with the c64-knowledge skill. Select the kind of the switch:
|
|
93
|
+
- `protection`: a copy protection, or the code that a crack changed to remove it.
|
|
94
|
+
- `trainer` or `cheat`: a trainer or a cheat.
|
|
95
|
+
- `crack`: another change of a cracker in the program, for example a credit text.
|
|
96
|
+
- `fix`: a correction of a bug. Make one switch for each correction, not one switch for each release.
|
|
97
|
+
- `change`: another difference.
|
|
98
|
+
9. Give the switch the labels of the releases that have it on. The patch holds the bytes of the state that the base release does not have.
|
|
99
|
+
10. Record each other conclusion as a comment or a region with the c64-knowledge skill.
|
|
92
100
|
|
|
93
101
|
## One release
|
|
94
102
|
|
|
@@ -136,7 +144,7 @@ Do these steps:
|
|
|
136
144
|
4. Run `leftovers`. When you have two or more releases, also compare them.
|
|
137
145
|
5. Read `text` first: names, dates, greetings and credits. Then read `copies`, `residue`, `basic` and `deadCode`.
|
|
138
146
|
6. Examine each important finding with the c64-emulator skill or the c64-static-analysis skill.
|
|
139
|
-
7. Record each confirmed finding with the c64-knowledge skill. Classify a confirmed PETSCII text as a `petscii` region, and a screen code text as a `screen` region. Classify other text as `bytes`. Write a comment that tells what the leftover is.
|
|
147
|
+
7. Record each confirmed finding with the c64-knowledge skill. Do not remove a leftover from the program: a rebuild keeps it. Only the data of a cracktro goes out, with `capture --exclude` of the c64-unpacker skill. Classify a confirmed PETSCII text as a `petscii` region, and a screen code text as a `screen` region. Classify other text as `bytes`. Write a comment that tells what the leftover is.
|
|
140
148
|
|
|
141
149
|
Read the findings with care:
|
|
142
150
|
|
|
@@ -187,7 +195,7 @@ To find the routines in a program:
|
|
|
187
195
|
Automatic write:
|
|
188
196
|
- none.
|
|
189
197
|
|
|
190
|
-
Record a confirmed conclusion as a normal comment, region or
|
|
198
|
+
Record a confirmed conclusion as a normal comment, region, symbol, release, switch or patch with the c64-knowledge skill. Do not record the full comparison or the full list of leftovers.
|
|
191
199
|
|
|
192
200
|
`match --out` writes a batch file and does not change the knowledge. Apply the batch with the c64-knowledge skill.
|
|
193
201
|
|