velxio/test/test_custom_chips/sdk/examples/galaksija-ram-display.chip....

10 lines
776 B
JSON
Raw Normal View History

fix(chipbus): Galaksija boots + displays + types live in the browser The gallery example loaded but the Z80 never visibly ran: the screen stayed frozen on garbage. Two multi-chip async-load races, neither caught by the existing headless tests (which drive RESET manually and attach the display before boot): 1. RESET edge-vs-level race. The Z80 only left reset on the RISING edge of RESET (a pin watch). In the browser the 7 chips instantiate asynchronously, so the small power-on-reset chip releases RESET before the larger Z80 has registered its watch -> the edge is lost and the CPU stays in reset forever. Fix: on_clock samples the RESET level (hardware-accurate; RESET is level-sensitive) so a missed edge self-corrects. An undriven RESET reads low, so the CPU safely stays in reset until something drives it high. Repro/guard: chipbus-galaksija-reset-race (race ordering must still boot). 2. Display-snoop load-order race. galaksija-display was a passive write-snoop; the ROM paints the screen ONCE at boot then idles, so a display that comes up late misses every write and shows stale content forever. A snoop cannot recover writes it never saw. Fix: fold the screen into the RAM chip (galaksija-ram-display) and render from the ACTUAL video RAM (0x2800-0x2BFF, internal 0x0800 with A0-A12 wiring) on a ~30 fps timer - correct regardless of load order, exactly how the real machine scans video RAM. Repro/guard: chipbus-galaksija-display-snoop-race (late snoop shows nothing) + chipbus-galaksija-ram-display (renders even when first paint is post-boot). The example now has 6 chips (RAM+display merged, gdisp dropped), 76 wires. Verified live in the browser: boots to "@'READY", shows the ">" prompt, and pressing A echoes ">A_" through keyboard -> Z80 -> video RAM -> display. The full chipbus suite is 45/45. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 01:47:30 +07:00
{
"schema": "velxio-chip/v1",
"name": "RAM 64K + Display (Galaksija)",
"author": "Velxio (font8x8: Daniel Hepper / Marcel Sondaar, public domain)",
"license": "MIT (chip) / public-domain (font)",
"description": "64KB SRAM that also renders the Galaksija 32x16 text screen from its own video RAM (0x2800-0x2BFF) into a 256x128 framebuffer on a ~30fps timer. Reads from real memory (not snooped writes) so the picture is correct regardless of chip load order. Yields reads of 0x2000-0x203F to the memory-mapped keyboard. Phase 3 chip-to-chip bus proof.",
"display": { "width": 256, "height": 128 },
"pins": ["A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","A13","A14","A15","D0","D1","D2","D3","D4","D5","D6","D7","CE","OE","WE","VCC","GND"]
}