velxio/test/test_custom_chips/sdk/examples
David Montero Crespo 47adb0b1c8 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-05 15:47:30 -03:00
..
bus-driver.c
bus-driver.chip.json
bus-reader.c
bus-reader.chip.json
cd4094.c
cd4094.chip.json
ds3231.c
ds3231.chip.json
eeprom-24c01.c
eeprom-24c01.chip.json
eeprom-24lc256.c
eeprom-24lc256.chip.json
galaksija-display.c feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
galaksija-display.chip.json feat(chipbus): Galaksija video display chip - full computer renders READY 2026-06-05 12:14:40 -03:00
galaksija-keyboard.c feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
galaksija-keyboard.chip.json feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
galaksija-ram-display.c fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
galaksija-ram-display.chip.json fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
galaksija-ram.c feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
galaksija-ram.chip.json feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
galaksija-rom.c test(chipbus): a real Galaksija (1983 Z80 home computer) boots over the bus 2026-06-05 11:55:28 -03:00
galaksija-rom.chip.json test(chipbus): a real Galaksija (1983 Z80 home computer) boots over the bus 2026-06-05 11:55:28 -03:00
inverter.c
inverter.chip.json
mcp3008.c
mcp3008.chip.json
pcf8574.c
pcf8574.chip.json
pulse-counter.c
pulse-counter.chip.json
reset-gen.c feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
reset-gen.chip.json feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
sn74hc595.c
sn74hc595.chip.json
uart-rot13.c
uart-rot13.chip.json
xor.c
xor.chip.json
z80-boot-rom.c
z80-boot-rom.chip.json
z80-ram-rom.c test(chipbus): Phase 3 core - Z80 + ROM + RAM + address decode over the bus 2026-06-05 10:23:57 -03:00
z80-ram-rom.chip.json test(chipbus): Phase 3 core - Z80 + ROM + RAM + address decode over the bus 2026-06-05 10:23:57 -03:00