Catalog the Commodore 1351 mouse for C, mixed C + ca65, ca65 and native assembler (BASIC V2 / 7.0 report a conflict). Briefs that list it get VICE -controlport1device 3 in their emulator arguments, with a mouse-grab note in the generated toolchain docs. Adds the mouse-1351-c and conflict-basic-mouse test briefs and the verification log addendum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>main
| @@ -95,7 +95,15 @@ | |||
| "sid-sound": "Sound effects or music through the SID.", | |||
| "smooth-animation": "Several objects updated every frame or every few frames in a steady frame-locked loop.", | |||
| "raster-interrupts": "Cycle-sensitive raster interrupts, raster splits or stable raster timing.", | |||
| "vdc-80col": "Native C128 80-column output through the VDC (8563/8568)." | |||
| "vdc-80col": "Native C128 80-column output through the VDC (8563/8568).", | |||
| "mouse-1351": "Commodore 1351 mouse in proportional mode in control port 1 (cc65 drivers c64_1351_mou / c128_1351_mou, or POT reads in assembly). VICE emulates it on control port 1." | |||
| }, | |||
| "capabilityEmulator": { | |||
| "mouse-1351": { | |||
| "args": ["-controlport1device", "3"], | |||
| "note": "Control port 1 = Mouse (1351). Grab the host mouse in VICE with Alt+M (default GTK3 hotkeys; Alt+Q with the WinVICE legacy hotkey file) or start VICE with -mouse; without a grab the C64 pointer does not move. Press Alt+M again to release it.", | |||
| "sources": ["x64sc -help / x128 -help (VICE 3.10): -controlport1device 3 = Mouse (1351); -mouse = Enable mouse grab", "VICE 3.10 hotkeys/hotkeys.vhk: mouse-grab-toggle <Alt>m","https://cc65.github.io/doc/c64.html#toc6.3 (c64-1351.mou: standard mouse in port #0, i.e. control port 1)"] | |||
| } | |||
| }, | |||
| "platforms": { | |||
| "c64": { "title": "Commodore 64", "displays": ["vicii-40"] }, | |||
| @@ -113,7 +121,7 @@ | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound"], | |||
| "screenEncoding": "screen-upper", | |||
| "strengths": "No compiler needed; editable on the machine itself; quickest to change.", | |||
| "limits": "Interpreted: roughly hundreds of simple statements per second, so many moving objects or frame-locked logic are out of reach. No 80-column output." | |||
| "limits": "Interpreted: roughly hundreds of simple statements per second, so many moving objects or frame-locked logic are out of reach. No 80-column output. No 1351 mouse: proportional mouse reading needs per-frame POT sampling and delta tracking that BASIC cannot keep up with." | |||
| }, | |||
| "basic-7": { | |||
| "title": "Commodore BASIC 7.0 (C128 ROM BASIC)", | |||
| @@ -121,12 +129,12 @@ | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "vdc-80col"], | |||
| "screenEncoding": "screen-upper", | |||
| "strengths": "Structured loops, SPRITE/SOUND/PLAY/GRAPHIC commands, 80-column text with no extra code; editable on the C128.", | |||
| "limits": "Interpreted and slow for real-time games; C128 native mode only." | |||
| "limits": "Interpreted and slow for real-time games; C128 native mode only. No 1351 mouse driver (proportional mouse reading needs per-frame POT sampling)." | |||
| }, | |||
| "c": { | |||
| "title": "C (cc65)", | |||
| "platforms": ["c64", "c128-native", "c128-c64mode"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "vdc-80col"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "vdc-80col", "mouse-1351"], | |||
| "screenEncoding": "screen-mixed", | |||
| "strengths": "Readable, portable between C64 and C128 with #ifdef, conio/cbm file I/O library, much faster than BASIC.", | |||
| "limits": "Larger and slower code than hand-written assembly; not suitable for cycle-exact raster work without assembly help." | |||
| @@ -134,7 +142,7 @@ | |||
| "asm-ca65": { | |||
| "title": "6502 assembly (ca65)", | |||
| "platforms": ["c64", "c128-native", "c128-c64mode"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col", "mouse-1351"], | |||
| "screenEncoding": "screen-upper", | |||
| "strengths": "Full control of timing and memory; smallest and fastest code.", | |||
| "limits": "Most effort to write, review and change." | |||
| @@ -142,7 +150,7 @@ | |||
| "mixed-c-asm": { | |||
| "title": "C (cc65) with ca65 assembly modules", | |||
| "platforms": ["c64", "c128-native", "c128-c64mode"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col", "mouse-1351"], | |||
| "screenEncoding": "screen-mixed", | |||
| "strengths": "Game/app logic in C, timing-critical subsystems (frame sync, raster IRQs, inner loops) in assembly.", | |||
| "limits": "Two languages and the cc65 calling convention to keep straight." | |||
| @@ -150,7 +158,7 @@ | |||
| "asm-onboard": { | |||
| "title": "6502 assembly written and assembled on the Commodore (native assembler)", | |||
| "platforms": ["c64", "c128-native"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col"], | |||
| "capabilities": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col", "mouse-1351"], | |||
| "screenEncoding": "screen-upper", | |||
| "strengths": "Authentic on-machine workflow.", | |||
| "limits": "Depends on a user-supplied native assembler; source lives in the assembler's own file format." | |||
| @@ -94,7 +94,7 @@ The **resume stage** is the first interview stage with missing fields. If nothin | |||
| | `scope.firstRelease` | One paragraph | | |||
| | `scope.inScope[]`, `scope.outOfScope[]` | Both non-empty | | |||
| | `requirements[]` | `{ id: R1.., title, priority: must/should/could, text, acceptance[] (observable), capabilities[] }` | | |||
| | `capabilities[]` | Union of what the project needs; names from `catalog/recipes.json` (`text-ui`, `keyboard-input`, `joystick-input`, `disk-seq-io`, `sprites`, `custom-charset`, `sid-sound`, `smooth-animation`, `raster-interrupts`, `vdc-80col`). The validator checks them against the language and display. | | |||
| | `capabilities[]` | Union of what the project needs; names from `catalog/recipes.json` (`text-ui`, `keyboard-input`, `joystick-input`, `disk-seq-io`, `sprites`, `custom-charset`, `sid-sound`, `smooth-animation`, `raster-interrupts`, `vdc-80col`, `mouse-1351`). The validator checks them against the language and display. Capabilities listed under `capabilityEmulator` in the catalog also add emulator options to every target (`mouse-1351`: VICE `-controlport1device 3`). | | |||
| ### `design` | |||
| @@ -38,8 +38,9 @@ Check each criterion that applies: | |||
| | C64/C128 portability | separate dialects | one source, `-t c64` / `-t c128` | yes | per-target code | | |||
| | Maintainability | easy to read, hard to structure | good | good, if the asm stays small | hardest | | |||
| | On-machine editing | yes | no | no | only with a native assembler | | |||
| | Commodore 1351 mouse (`mouse-1351`) | no (conflict) | cc65 driver `c64_1351_mou` / `c128_1351_mou` | yes | yes (link the cc65 driver or read the SID POT registers) | | |||
| The capability names in the brief (`smooth-animation`, `raster-interrupts`, `vdc-80col`, ...) | |||
| The capability names in the brief (`smooth-animation`, `raster-interrupts`, `vdc-80col`, `mouse-1351`, ...) | |||
| are checked against these limits by the validator. A user override that breaks one is reported | |||
| as a **conflict**, and the user decides which constraint to change. | |||
| @@ -61,6 +62,7 @@ by `tests/Run-FoundryTests.ps1` on 2026-11-26 with: | |||
| | `cc65` | ca65 | c128-native / vicii-40 | `x128 -40col` | verified | c128-40-asm | | |||
| | `cc65` | C | c128-native / vdc-80 | `x128 -80col` | verified | examples/c128-text-viewer (disk autostart), dual-native, multi-display-c | | |||
| | `cc65` | C | c128-c64mode / vicii-40 | `x128 -go64` | verified | dual-c64mode-c | | |||
| | `cc65` | C + 1351 mouse | c64 / vicii-40 | `x64sc -controlport1device 3` | verified (driver install; pointer movement is a manual check) | mouse-1351-c | | |||
| | `cc65` | ca65 | c128-native / vdc-80 | `x128 -80col` | **unverified** | validation plan in the catalog | | |||
| | `basic-petcat` | BASIC V2 | c64 / vicii-40 | `x64sc` | verified | dual-c64mode (c64) | | |||
| | `basic-petcat` | BASIC V2 | c128-c64mode / vicii-40 | `x128 -go64` | verified | dual-c64mode (c128-in-c64-mode) | | |||
| @@ -95,6 +97,8 @@ C128 note: cc65 c128 programs load at `$1C01`. `videomode(VIDEOMODE_80COL)` swit | |||
| | `-8 <image>` | Attach a disk image to drive 8 | VICE `-help` | | |||
| | `-40col` / `-80col` / `-go64` | x128 display key / C64 mode | [VICE manual 7.2.4.2](https://vice-emu.sourceforge.io/vice_7.html#SEC194) | | |||
| | `-pal` / `-ntsc` | Video standard | VICE `-help` | | |||
| | `-controlport1device 3` | Commodore 1351 mouse in control port 1; added automatically for briefs with the `mouse-1351` capability | `x64sc -help` / `x128 -help` (VICE 3.10) | | |||
| | `-mouse` / hotkey Alt+M | Grab the host mouse so it drives the emulated 1351 (GTK3 default hotkey; the WinVICE legacy hotkey file uses Alt+Q) | `x64sc -help`; `hotkeys/hotkeys.vhk` in the VICE 3.10 install | | |||
| | `-limitcycles <n>` | Exit after n cycles (smoke runs end this way) | [VICE manual 2.1](https://vice-emu.sourceforge.io/vice_2.html#SEC50) | | |||
| | `-exitscreenshot` / `-exitscreenshotvicii` | Screenshot on exit (x128: VDC / VIC-II window) | [VICE manual 2.1](https://vice-emu.sourceforge.io/vice_2.html#SEC50) | | |||
| | `-moncommands <file>` | Monitor commands at start (tracepoints) | [VICE manual 6.17.2](https://vice-emu.sourceforge.io/vice_6.html#SEC139) | | |||
| @@ -73,3 +73,25 @@ pwsh -File tools/New-FoundryProject.ps1 examples/c128-text-viewer/brief.json | |||
| | ca65-only programs on the C128 80-column screen | No starter writes to the VDC from assembly yet | Validation plan in `catalog/recipes.json` (`cc65` combo `c128-native`/`vdc-80`/`asm-ca65`) | | |||
| | `winget install VICE-Team.VICE.GTK3` install location | VICE was installed from the zip on this machine. The winget install folder is searched (`%LOCALAPPDATA%\Microsoft\WinGet\Packages\VICE-Team.VICE.GTK3*\*\bin`) but not observed | Install with winget on a clean machine and run `tools/check-prereqs.ps1`; if VICE is not found, set `VICE_HOME` and update `searchPaths` in the catalog | | |||
| | NTSC smoke run | Smoke tests use PAL; NTSC is selectable (`-Video ntsc` in run.ps1) but not automated | Traffic Control 64 MT2.6 covers it during implementation | | |||
| ## 5. Addendum 2026-11-26: `mouse-1351` capability | |||
| Added the Commodore 1351 mouse as a catalog capability (C, mixed C + ca65, ca65 and native assembler; not BASIC V2 / 7.0). | |||
| Briefs that list it get `-controlport1device 3` (VICE: control port 1 = Mouse (1351)) in their resolved emulator | |||
| arguments, so `tools/run.ps1` and `tools/smoke.ps1` attach the mouse; `docs/toolchain.md` carries the mouse-grab note | |||
| (Alt+M in the VICE 3.10 GTK3 default hotkeys, from `hotkeys/hotkeys.vhk`; Alt+Q only with the WinVICE legacy file). | |||
| ```powershell | |||
| pwsh -File tests/Run-FoundryTests.ps1 | |||
| ``` | |||
| Outcome: **116 passed, 0 failed, 0 skipped**. | |||
| | New check | Result | | |||
| |---|---| | |||
| | `mouse-1351-c` (C64, C): validates, generates, builds; smoke test in x64sc with `-controlport1device 3` finds 'MOUSE OK' (cc65 `c64_1351_mou` installed via `mouse_install`) | pass | | |||
| | `conflict-basic-mouse` (BASIC V2 + `mouse-1351`): exit 4 with a CONFLICT that asks the user which constraint to change; generator refuses | pass | | |||
| | Resolver adds the mouse port option only when the capability is listed | pass | | |||
| Still manual: pointer movement and button presses with a grabbed host mouse (headless VICE has no host mouse), | |||
| and the C128 driver `c128_1351_mou` (present in the cc65 snapshot, not exercised by a test brief). | |||
| @@ -206,7 +206,7 @@ | |||
| } | |||
| }, | |||
| "$defs": { | |||
| "capability": { "enum": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col"] }, | |||
| "capability": { "enum": ["text-ui", "keyboard-input", "joystick-input", "disk-seq-io", "sprites", "custom-charset", "sid-sound", "smooth-animation", "raster-interrupts", "vdc-80col", "mouse-1351"] }, | |||
| "language": { "enum": ["basic-v2", "basic-7", "c", "asm-ca65", "mixed-c-asm", "asm-onboard"] }, | |||
| "decision": { | |||
| "type": "object", | |||
| @@ -78,9 +78,10 @@ $examples = @( | |||
| $valid = @( | |||
| @{ Name = 'c128-40-basic7'; Expect = 0 }, @{ Name = 'dual-native'; Expect = 0 }, @{ Name = 'dual-c64mode'; Expect = 0 }, | |||
| @{ Name = 'on-commodore-basic'; Expect = 0 }, @{ Name = 'override-asm'; Expect = 0 }, @{ Name = 'unverified-onboard-asm'; Expect = 3 }, | |||
| @{ Name = 'multi-display-c'; Expect = 0 }, @{ Name = 'c128-40-asm'; Expect = 0 }, @{ Name = 'dual-c64mode-c'; Expect = 0 }, @{ Name = 'c128-80-basic7'; Expect = 0 }, @{ Name = 'on-commodore-basic7'; Expect = 0 } | |||
| @{ Name = 'multi-display-c'; Expect = 0 }, @{ Name = 'c128-40-asm'; Expect = 0 }, @{ Name = 'dual-c64mode-c'; Expect = 0 }, @{ Name = 'c128-80-basic7'; Expect = 0 }, @{ Name = 'on-commodore-basic7'; Expect = 0 }, | |||
| @{ Name = 'mouse-1351-c'; Expect = 0 } | |||
| ) | ForEach-Object { $_.Brief = Join-Path $root "tests/briefs/$($_.Name).json"; $_ } | |||
| $conflicts = 'conflict-basic7-on-c64', 'conflict-80col-on-c64', 'conflict-override-capability', 'conflict-build-location' | |||
| $conflicts = 'conflict-basic7-on-c64', 'conflict-80col-on-c64', 'conflict-override-capability', 'conflict-build-location', 'conflict-basic-mouse' | |||
| $all = @($examples) + @($valid) | |||
| # --------------------------------------------------------------------------- | |||
| @@ -122,6 +123,15 @@ if ('validation' -in $Group) { | |||
| $res = Test-FoundryBrief -Brief $b -Mode Approved | |||
| Assert (@($res.Errors | Where-Object { $_.Message -match 'takes precedence' }).Count -eq 1) 'missing precedence error' | |||
| } | |||
| Invoke-Check 'validation: mouse-1351 adds VICE 1351 mouse emulation on control port 1' { | |||
| $r = Resolve-FoundryProject -Brief (Read-FoundryJson (Join-Path $root 'tests/briefs/mouse-1351-c.json')) | |||
| $emuArgs = @($r.targets[0].emulator.args) -join ' ' | |||
| Assert ($emuArgs -match '-controlport1device 3') "emulator args: $emuArgs" | |||
| Assert (@($r.targets[0].emulator.notes).Count -eq 1) 'mouse emulator note missing' | |||
| $r2 = Resolve-FoundryProject -Brief (Read-FoundryJson (Join-Path $root 'tests/briefs/dual-c64mode-c.json')) | |||
| Assert (-not ((@($r2.targets[0].emulator.args) -join ' ') -match 'controlport')) 'mouse args added without the capability' | |||
| $emuArgs | |||
| } | |||
| Invoke-Check 'validation: dual-target strategy must match the targets' { | |||
| $b = Read-FoundryJson (Join-Path $root 'tests/briefs/dual-native.json') | |||
| $b.dualTarget.strategy = 'c64-mode-on-both' | |||
| @@ -0,0 +1,194 @@ | |||
| { | |||
| "schemaVersion": "1.0", | |||
| "status": "approved", | |||
| "approval": { | |||
| "approvedBy": "automated test", | |||
| "approvedOn": "2026-11-26" | |||
| }, | |||
| "interview": { | |||
| "stage": "review", | |||
| "openQuestions": [], | |||
| "notes": [ | |||
| "Test fixture brief for the Foundry automated checks." | |||
| ] | |||
| }, | |||
| "project": { | |||
| "name": "Conflict BASIC mouse", | |||
| "slug": "conflict-basic-mouse", | |||
| "idea": "Test idea for Conflict BASIC mouse.", | |||
| "summary": "Test project: BASIC V2 with a 1351 mouse requirement.", | |||
| "kind": "other", | |||
| "smallestUsefulVersion": "Shows its title screen and waits for a key." | |||
| }, | |||
| "destination": "../Foundry Test Output/conflict-basic-mouse", | |||
| "targets": [ | |||
| { | |||
| "id": "c64", | |||
| "platform": "c64", | |||
| "display": "vicii-40", | |||
| "video": "pal", | |||
| "expectedBehavior": "Runs on a C64." | |||
| }, | |||
| { | |||
| "id": "c128-in-c64-mode", | |||
| "platform": "c128-c64mode", | |||
| "display": "vicii-40", | |||
| "video": "pal", | |||
| "expectedBehavior": "The same PRG runs on a C128 after GO 64." | |||
| } | |||
| ], | |||
| "dualTarget": { | |||
| "strategy": "c64-mode-on-both", | |||
| "notes": "One BASIC V2 program. On a C128 the user enters C64 mode first; no native C128 build." | |||
| }, | |||
| "buildLocation": "windows-cross", | |||
| "onCommodore": null, | |||
| "testing": { | |||
| "emulator": "vice", | |||
| "realHardware": { | |||
| "requested": false, | |||
| "reason": "" | |||
| } | |||
| }, | |||
| "scope": { | |||
| "firstRelease": "Title screen and one interaction.", | |||
| "inScope": [ | |||
| "Title screen" | |||
| ], | |||
| "outOfScope": [ | |||
| "Everything else" | |||
| ] | |||
| }, | |||
| "requirements": [ | |||
| { | |||
| "id": "R1", | |||
| "title": "Title screen", | |||
| "priority": "must", | |||
| "text": "Shows the title and waits for a key.", | |||
| "acceptance": [ | |||
| "Row 0 shows 'MORSE TRAINER'" | |||
| ], | |||
| "capabilities": [ | |||
| "text-ui", | |||
| "mouse-1351" | |||
| ] | |||
| }, | |||
| { | |||
| "id": "R2", | |||
| "title": "Key response", | |||
| "priority": "must", | |||
| "text": "A key press returns to BASIC.", | |||
| "acceptance": [ | |||
| "Any key returns to the READY prompt" | |||
| ], | |||
| "capabilities": [ | |||
| "keyboard-input" | |||
| ] | |||
| } | |||
| ], | |||
| "design": { | |||
| "controls": { | |||
| "value": "Any key.", | |||
| "source": "default" | |||
| }, | |||
| "visuals": { | |||
| "value": "Text only.", | |||
| "source": "default" | |||
| }, | |||
| "sound": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "persistence": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "fileFormats": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "peripherals": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "budgets": { | |||
| "value": "No constraints beyond fitting in memory.", | |||
| "source": "default" | |||
| } | |||
| }, | |||
| "capabilities": [ | |||
| "text-ui", | |||
| "keyboard-input", | |||
| "sid-sound", | |||
| "mouse-1351" | |||
| ], | |||
| "assumptions": [ | |||
| { | |||
| "id": "A1", | |||
| "text": "VICE defaults are representative.", | |||
| "status": "default" | |||
| } | |||
| ], | |||
| "openDecisions": [], | |||
| "toolchain": { | |||
| "recipe": "basic-petcat", | |||
| "language": "basic-v2", | |||
| "recommended": { | |||
| "recipe": "basic-petcat", | |||
| "language": "basic-v2" | |||
| }, | |||
| "reasons": [ | |||
| "A Morse trainer needs only text, keys and SID tones; BASIC V2 is enough and runs on both machines in C64 mode." | |||
| ], | |||
| "alternatives": [ | |||
| { | |||
| "option": "Assembly", | |||
| "whyNot": "More effort than this needs." | |||
| } | |||
| ], | |||
| "override": null, | |||
| "assumptionsToVerify": [] | |||
| }, | |||
| "starter": { | |||
| "screenTitle": "MORSE TRAINER", | |||
| "expectedScreen": "'MORSE TRAINER' on row 0 and 'STARTER OK' on row 2.", | |||
| "requirements": [ | |||
| "R1" | |||
| ] | |||
| }, | |||
| "milestones": [ | |||
| { | |||
| "id": "M1", | |||
| "title": "Key handling", | |||
| "goal": "Return to BASIC on a key press.", | |||
| "tasks": [ | |||
| { | |||
| "id": "M1.1", | |||
| "text": "Return to BASIC on any key.", | |||
| "requirements": [ | |||
| "R2" | |||
| ], | |||
| "outcome": "PRG that exits on a key", | |||
| "check": "MT1.1" | |||
| } | |||
| ], | |||
| "manualTests": [ | |||
| { | |||
| "id": "MT1.1", | |||
| "title": "Exit", | |||
| "target": "all", | |||
| "setup": "Program running.", | |||
| "steps": [ | |||
| "Press SPACE." | |||
| ], | |||
| "expected": [ | |||
| "READY prompt appears." | |||
| ], | |||
| "requirements": [ | |||
| "R2" | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| @@ -0,0 +1,50 @@ | |||
| /* Mouse Probe - Foundry test fixture for the mouse-1351 capability. | |||
| ** Installs the statically linked cc65 1351 driver (control port 1), shows sprite 0 | |||
| ** as the pointer and reports the install result on row 3. | |||
| */ | |||
| #include <conio.h> | |||
| #include <string.h> | |||
| #include <mouse.h> | |||
| #include <c64.h> | |||
| #include "smoke.h" | |||
| #define SPRITE_BLOCK 13 /* $0340: cassette buffer, free while the program runs */ | |||
| static const unsigned char arrow[21] = { | |||
| 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xF8, 0xD8, 0x8C, 0x0C, 0x06, | |||
| 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |||
| }; | |||
| int main(void) | |||
| { | |||
| unsigned char *spr = (unsigned char *)(SPRITE_BLOCK * 64); | |||
| unsigned char i, rc; | |||
| memset(spr, 0, 64); | |||
| for (i = 0; i < sizeof arrow; ++i) { | |||
| spr[i * 3] = arrow[i]; | |||
| } | |||
| *(unsigned char *)0x07F8 = SPRITE_BLOCK; | |||
| VIC.spr0_color = COLOR_WHITE; | |||
| clrscr(); | |||
| cputsxy(0, 0, "MOUSE PROBE"); | |||
| cputsxy(0, 2, "STARTER OK"); | |||
| rc = mouse_install(&mouse_def_callbacks, c64_1351_mou); | |||
| if (rc == MOUSE_ERR_OK) { | |||
| mouse_show(); | |||
| cputsxy(0, 3, "MOUSE OK"); | |||
| } else { | |||
| cputsxy(0, 3, "MOUSE ERROR"); | |||
| } | |||
| cputsxy(0, 5, "ANY KEY EXITS"); | |||
| smoke_capture(); | |||
| smoke_ready(); | |||
| while (!kbhit()) { } | |||
| cgetc(); | |||
| if (rc == MOUSE_ERR_OK) { | |||
| mouse_uninstall(); | |||
| } | |||
| clrscr(); | |||
| return 0; | |||
| } | |||
| @@ -0,0 +1,217 @@ | |||
| { | |||
| "schemaVersion": "1.0", | |||
| "status": "approved", | |||
| "approval": { | |||
| "approvedBy": "automated test", | |||
| "approvedOn": "2026-11-26" | |||
| }, | |||
| "interview": { | |||
| "stage": "review", | |||
| "openQuestions": [], | |||
| "notes": [ | |||
| "Test fixture brief for the Foundry automated checks." | |||
| ] | |||
| }, | |||
| "project": { | |||
| "name": "Mouse Probe", | |||
| "slug": "mouse-probe", | |||
| "idea": "Test idea for Mouse Probe.", | |||
| "summary": "Test project: a C64 C program that installs the cc65 1351 mouse driver.", | |||
| "kind": "other", | |||
| "smallestUsefulVersion": "Shows its title screen and waits for a key." | |||
| }, | |||
| "destination": "../Foundry Test Output/mouse-probe", | |||
| "targets": [ | |||
| { | |||
| "id": "c64", | |||
| "platform": "c64", | |||
| "display": "vicii-40", | |||
| "video": "pal", | |||
| "expectedBehavior": "Installs the 1351 mouse driver and reports the result." | |||
| } | |||
| ], | |||
| "dualTarget": null, | |||
| "buildLocation": "windows-cross", | |||
| "onCommodore": null, | |||
| "testing": { | |||
| "emulator": "vice", | |||
| "realHardware": { | |||
| "requested": false, | |||
| "reason": "" | |||
| } | |||
| }, | |||
| "scope": { | |||
| "firstRelease": "Title screen and one interaction.", | |||
| "inScope": [ | |||
| "Title screen" | |||
| ], | |||
| "outOfScope": [ | |||
| "Everything else" | |||
| ] | |||
| }, | |||
| "requirements": [ | |||
| { | |||
| "id": "R1", | |||
| "title": "Title screen", | |||
| "priority": "must", | |||
| "text": "Shows the title and waits for a key.", | |||
| "acceptance": [ | |||
| "Row 0 shows 'POCKET PLANNER'" | |||
| ], | |||
| "capabilities": [ | |||
| "text-ui" | |||
| ] | |||
| }, | |||
| { | |||
| "id": "R2", | |||
| "title": "Key response", | |||
| "priority": "must", | |||
| "text": "A key press returns to BASIC.", | |||
| "acceptance": [ | |||
| "Any key returns to the READY prompt" | |||
| ], | |||
| "capabilities": [ | |||
| "keyboard-input" | |||
| ] | |||
| }, | |||
| { | |||
| "id": "R3", | |||
| "title": "1351 mouse", | |||
| "priority": "must", | |||
| "text": "Installs the cc65 1351 mouse driver (control port 1) and shows MOUSE OK when it reports no error.", | |||
| "acceptance": [ | |||
| "Row 3 shows MOUSE OK", | |||
| "Moving the grabbed host mouse in VICE moves the sprite pointer" | |||
| ], | |||
| "capabilities": [ | |||
| "mouse-1351", | |||
| "sprites" | |||
| ] | |||
| } | |||
| ], | |||
| "design": { | |||
| "controls": { | |||
| "value": "Any key.", | |||
| "source": "default" | |||
| }, | |||
| "visuals": { | |||
| "value": "Text only.", | |||
| "source": "default" | |||
| }, | |||
| "sound": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "persistence": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "fileFormats": { | |||
| "value": "None.", | |||
| "source": "n/a" | |||
| }, | |||
| "peripherals": { | |||
| "value": "Commodore 1351 mouse in control port 1.", | |||
| "source": "default" | |||
| }, | |||
| "budgets": { | |||
| "value": "No constraints beyond fitting in memory.", | |||
| "source": "default" | |||
| } | |||
| }, | |||
| "capabilities": [ | |||
| "text-ui", | |||
| "keyboard-input", | |||
| "mouse-1351", | |||
| "sprites" | |||
| ], | |||
| "assumptions": [ | |||
| { | |||
| "id": "A1", | |||
| "text": "VICE defaults are representative.", | |||
| "status": "default" | |||
| } | |||
| ], | |||
| "openDecisions": [], | |||
| "toolchain": { | |||
| "recipe": "cc65", | |||
| "language": "c", | |||
| "recommended": { | |||
| "recipe": "cc65", | |||
| "language": "c" | |||
| }, | |||
| "reasons": [ | |||
| "C gives structured data handling at good speed." | |||
| ], | |||
| "alternatives": [ | |||
| { | |||
| "option": "Assembly", | |||
| "whyNot": "More effort than this needs." | |||
| } | |||
| ], | |||
| "override": null, | |||
| "assumptionsToVerify": [] | |||
| }, | |||
| "starter": { | |||
| "screenTitle": "MOUSE PROBE", | |||
| "expectedScreen": "MOUSE PROBE on row 0, STARTER OK on row 2, MOUSE OK on row 3; the mouse pointer (sprite 0) follows the grabbed host mouse.", | |||
| "requirements": [ | |||
| "R1", | |||
| "R3" | |||
| ], | |||
| "smokeChecks": [ | |||
| { | |||
| "row": 0, | |||
| "col": 0, | |||
| "text": "MOUSE PROBE" | |||
| }, | |||
| { | |||
| "row": 2, | |||
| "col": 0, | |||
| "text": "STARTER OK" | |||
| }, | |||
| { | |||
| "row": 3, | |||
| "col": 0, | |||
| "text": "MOUSE OK", | |||
| "description": "cc65 1351 driver installed (mouse_install returned MOUSE_ERR_OK)" | |||
| } | |||
| ], | |||
| "filesDir": "mouse-1351-c-files" | |||
| }, | |||
| "milestones": [ | |||
| { | |||
| "id": "M1", | |||
| "title": "Key handling", | |||
| "goal": "Return to BASIC on a key press.", | |||
| "tasks": [ | |||
| { | |||
| "id": "M1.1", | |||
| "text": "Return to BASIC on any key.", | |||
| "requirements": [ | |||
| "R2" | |||
| ], | |||
| "outcome": "PRG that exits on a key", | |||
| "check": "MT1.1" | |||
| } | |||
| ], | |||
| "manualTests": [ | |||
| { | |||
| "id": "MT1.1", | |||
| "title": "Exit", | |||
| "target": "all", | |||
| "setup": "Program running.", | |||
| "steps": [ | |||
| "Press SPACE." | |||
| ], | |||
| "expected": [ | |||
| "READY prompt appears." | |||
| ], | |||
| "requirements": [ | |||
| "R2" | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| @@ -417,6 +417,12 @@ function Resolve-FoundryProject([hashtable]$Brief, [hashtable]$Catalog = (Get-Fo | |||
| @{ row = 2; col = 0; text = 'STARTER OK'; description = "'STARTER OK' on row 2" } | |||
| ) | |||
| } | |||
| # Emulator options a capability needs on every target (for example a 1351 mouse in control port 1). | |||
| $capEmuArgs = @(); $capEmuNotes = @() | |||
| foreach ($c in Get-List $Brief.capabilities) { | |||
| $ce = if ($Catalog.Contains('capabilityEmulator')) { $Catalog.capabilityEmulator["$c"] } else { $null } | |||
| if ($ce) { $capEmuArgs += @($ce.args); if ($ce.note) { $capEmuNotes += "${c}: $($ce.note)" } } | |||
| } | |||
| $toolUse = [ordered]@{} | |||
| $addUse = { param($tool, $what) if (-not $toolUse.Contains($tool)) { $toolUse[$tool] = [System.Collections.Generic.List[string]]::new() }; if ($what -notin $toolUse[$tool]) { $toolUse[$tool].Add($what) } } | |||
| @@ -490,7 +496,7 @@ function Resolve-FoundryProject([hashtable]$Brief, [hashtable]$Catalog = (Get-Fo | |||
| platform = $t.platform; display = $t.display; video = $(if ($t.video -eq 'ntsc') { 'ntsc' } else { 'pal' }); videoSupport = $t.video | |||
| artifact = $artifact; expectedBehavior = $t.expectedBehavior | |||
| build = $build; disk = $disk | |||
| emulator = [ordered]@{ binary = $combo.emulator; args = @($combo.emulatorArgs); autostart = $autostart } | |||
| emulator = [ordered]@{ binary = $combo.emulator; args = @($combo.emulatorArgs) + @($capEmuArgs); autostart = $autostart; notes = @($capEmuNotes) } | |||
| smoke = $smoke | |||
| recipeStatus = $combo.status | |||
| validationPlan = @(Get-List $combo.validationPlan) | |||
| @@ -683,6 +689,7 @@ function New-DocVariables([hashtable]$Brief, $Resolved, [hashtable]$Catalog, [st | |||
| "- Build (what tools/build.ps1 runs): ``$buildCmd``") | |||
| if ($t.disk) { $lines += "- Disk image: ``$($t.disk.image)`` ($($t.disk.format), header ``$($t.disk.name)``), files: $((@($t.disk.files) | ForEach-Object { "$($_.name) ($($_.type))" }) -join ', ')" } | |||
| $lines += "- Emulator: ``$($t.emulator.binary) $emuArgs -autostart $runFile``" | |||
| foreach ($note in @(Get-List $t.emulator.notes)) { $lines += "- Emulator note - $note" } | |||
| if ($t.smoke) { | |||
| $readyText = if ($t.smoke.ready.symbol) { '`' + $t.smoke.ready.symbol + '`' } else { 'its marker store to $' + $t.smoke.ready.address } | |||
| $lines += "- Smoke test: ``pwsh -File tools/smoke.ps1 -Target $($t.id)``. It runs VICE headless for $($t.smoke.limitCycles) cycles, saves memory when the program reaches $readyText, and checks:" | |||
Powered by TurnKey Linux.