diff --git a/.claude/skills/c64-workflow/SKILL.md b/.claude/skills/c64-workflow/SKILL.md index cbf33d3..23b316b 100644 --- a/.claude/skills/c64-workflow/SKILL.md +++ b/.claude/skills/c64-workflow/SKILL.md @@ -85,9 +85,15 @@ fires it dumps RAM and I/O, decodes the text screen, and closes VICE. If a program replaces the Kernal IRQ (`$0314` to code that never reaches `$EA31`), the jiffy trigger never fires. Pass `-TickAddress ` instead. +Disk I/O also stops the jiffy count: the Kernal's serial routines run with IRQs off +while the C64 waits on the drive. Programs that use the disk should report through +`$D7FF` instead. + +`-Disk ` attaches a disk image to drive 8 for programs that use files (make a +blank one with `c1541 -format "work,01" d64 work.d64`). A manifest can set `"disk"` under `test`. Verdict: FAIL on timeout, on a non-zero `$D7FF` code, on a BASIC error (the runner -breaks on `$A437` and names the error, e.g. `BASIC error 11 (SYNTAX)`), or when any +breaks on `$A437` and names the error and line, e.g. `BASIC error 11 (SYNTAX) in line 40`), or when any `-Expect "TEXT"` is missing from the screen (case-insensitive; repeat `-Expect` for several strings). @@ -110,7 +116,7 @@ On real hardware `$D7FF` is an unused SID register image, so these stores do not and can stay in shipped code. `x64sc -debugcart` uses the same register (VICE exits with the stored value) if you need a bare-VICE check. -### Artifacts (`/build/test/`) +### Artifacts (`/build/test//`) | File | Contents | |------|----------| @@ -123,7 +129,7 @@ with the stored value) if you need a bare-VICE check. Inspect a variable: find it in `build/.lbl`, then read `ram.bin` at `2 + address`. For example, with pwsh: -`$r=[IO.File]::ReadAllBytes("build/test/ram.bin"); $r[2+0x0834]`. +`$r=[IO.File]::ReadAllBytes("build/test//ram.bin"); $r[2+0x0834]`. ### Testing patterns that work @@ -135,6 +141,7 @@ Inspect a variable: find it in `build/.lbl`, then read `ram.bin` at scripted moves) or check the state after a fixed number of jiffies. - **Regression set**: `c64 test projects/a projects/b examples/x.c` runs several and prints `n/m passed`. +- **Toolchain changes**: `pwsh tools/regress.ps1` runs the repository's full suite. ## Live debugging: `c64 run -Monitor` + `c64 mon` @@ -158,6 +165,15 @@ leading dot. Use `watch store ` to find who corrupts a variable, and `bank | BASIC (`.bas` via petcat) | either; it is lowered by default | petcat tokenizes lower-case keywords; `{clr}`, `{wht}`, `{down}` are control codes | | Screen RAM pokes | screen codes, not PETSCII | `A` = 1, `@` = 0, space = 32 | +BASIC builds sort lines by number, as the C64 editor does when you type them in (petcat +alone keeps file order, which breaks `GOTO` to a line placed earlier in the file). The +build warns about variable names that contain a keyword: `NOTE` tokenizes as `NOT E`, +and `WAVEFORM` as `WAVE FOR M` (even `SCORE` hides `OR`). Only the first two characters +of a variable name count, so `PLAYER1` and `PLAYER2` are the same variable `PL`. + +1541 gotcha: closing channel 15 makes the drive close every other open file. Open 15 +once, send commands with `PRINT#15,"S0:NAME"`, and close it last (`examples/disk-access.bas`). + ## Memory and build gotchas - cc65 C programs load at `$0801`. The C stack and heap sit below `$D000` by default. @@ -182,6 +198,9 @@ These shaped `tools/C64Tools.psm1`. Read them before you script VICE yourself: - `quit` is ignored inside a `command` string but works from a playback file. Quitting cleanly flushes `-monlog` and writes `-exitscreenshot`; killing the process loses both. - The monitor `screenshot` command hangs when it runs from a checkpoint. Use `-exitscreenshot`. +- Warp mode skips rendering frames, so `-exitscreenshot` can show a frame from well + before the trigger. `-refreshonbreak` redraws the display when the checkpoint hits, + which makes the screenshot match the dump. VICE 3.10 has no `-refresh` option. - `ignore ` on `break exec ea31` gives a deterministic "after N jiffies" trigger. A full-range `break exec 0000 ffff` with an ignore count never fired. - Autostarting a `.d64` is about 10 s slower than injecting the PRG diff --git a/.claude/skills/vice-emulator/SKILL.md b/.claude/skills/vice-emulator/SKILL.md index dd5e224..fb77ca8 100644 --- a/.claude/skills/vice-emulator/SKILL.md +++ b/.claude/skills/vice-emulator/SKILL.md @@ -344,7 +344,7 @@ The VICE manual explicitly warns that snapshot compatibility is not reliable acr Use the repository toolchain (`.claude/skills/c64-workflow/SKILL.md`) instead of raw command lines: 1. `c64 test `: headless run. Prints the decoded screen and PASS/FAIL, and leaves - `ram.bin`, `io.bin`, `screenshot.png`, and `monitor.log` in `build/test/`. + `ram.bin`, `io.bin`, `screenshot.png`, and `monitor.log` in `build/test//`. 2. `c64 test -Until