mirror of
https://github.com/st3fan/ewm.git
synced 2026-10-24 10:02:41 +00:00
Phase M2 of plans/20260721-01: a working AppleMouse II card when polled —
config, the device, the firmware, and the machine wiring. No interrupts yet
(Phase M4) and no host input yet (Phase M3); a program that calls the entry
points and reads the screen holes sees a real mouse.
- `ewm/src/mouse.rs`: `mouse_rom(slot)` — synthetic 256-byte firmware
implementing the eight documented entry points (found via the $Cn12 offset
table), moving bytes between the caller's screen holes and the card's
DEVSEL ports; and `Mou`, the `Device` + `Persist` holding position, per-axis
clamp, button (now + last), the moved flag, mode, and the read stream. The
DEVSEL protocol is ours (only our firmware touches it) — documented in the
module header. Identification: Pascal 1.1 ($Cn05=$38/$Cn07=$18/$Cn0B=$01/
$Cn0C=$20) + AppleMouse ($CnFB=$D6), with $Cn01≠$20 so the Autostart scan
skips it.
- Config: `SlotCard::Mouse` ("mouse"), any slot 1–7 (slot 0 already rejects
it), both families, at most one; no files, nothing to resolve. Schemas
regenerated.
- Machine: `SlotDevice::Mouse` wired into new_2plus / new_apple2 / new_2e
(DEVSEL device + $Cn00 firmware ROM); build_machine maps the card; `Two`
holds the handle for M3/M4.
Gates: the golden `mouse_rom(4)` byte test + a moved-slot operand test; the
device driven directly over its ports (Init→Clamp→Pos→Read, clamping); and
`two_mouse.rs` — a ][+ with a slot-4 mouse runs real 6502 through the
firmware entry points and the clamped result lands in the screen holes.
cargo fmt / clippy -D warnings / cargo test (377 pass, golden-BMP intact —
no mouse in those configs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>