velxio/frontend/src/simulation/customChips
David Montero Crespo 94627b99d2 feat(chipbus): Galaksija keyboard - type BASIC over the bus
Adds a memory-mapped keyboard so you can type into the Galaksija. Based on
the libretro Galaksija core's scheme (not guessed): reading 0x2000+offset
returns 0xFE when the key at that matrix offset is held, 0xFF otherwise;
the keyMap gives the offset per key ('A'=1 ... Enter=48, Space=31, etc.).

- galaksija-keyboard.c: drives reads of 0x2000-0x203F from a keys[] table and
  exports set_key(offset, down) for the host to push key events. Never drives
  outside the keyboard range.
- galaksija-ram.c: ram-64k variant that yields reads of 0x2000-0x203F to the
  keyboard (writes still go to RAM), so the two never fight for the bus.
- ChipRuntime: ChipInstance.hasKeyboard + setKey() expose the chip's set_key.
- CustomChipPart: bridges browser keydown/keyup (by KeyboardEvent.code, via
  GALAKSIJA_KEY_OFFSET) into the chip, ignoring keystrokes while the code
  editor or an input is focused so typing code is never hijacked.
- The gallery example gains the keyboard chip (now 7 chips, 99 wires) and uses
  galaksija-ram.

Test chipbus-galaksija-keyboard: pressing 'A' (offset 1) makes the BASIC
monitor echo "A" after its ">" prompt and advances the cursor. 41 chipbus
tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:37:42 -03:00
..
ChipRuntime.ts feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
SPIBus.ts Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
WasiShim.ts Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
busKernel.ts feat(chipbus): Phase 2 - synchronous settle kernel (settle-before-read) 2026-06-05 02:36:54 -03:00
busLogic.ts feat(chipbus): Phase 1 - 4-valued logic + drive-strength tri-state buses 2026-06-05 02:18:47 -03:00
busNets.ts feat(chipbus): Phase 2 - synchronous settle kernel (settle-before-read) 2026-06-05 02:36:54 -03:00
chipNets.ts feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
chipPinDrives.ts feat(custom-chip): make chip pins first-class circuit nodes (digital + SPICE) 2026-06-03 05:40:49 +02:00
index.ts Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
simulatorBridges.ts feat(attiny85+customchip): full ATtiny85 ADC/Timer0 + custom-chip pipeline fixes 2026-05-19 18:10:08 -03:00
syntheticPins.ts feat(chipbus): Phase 1 - 4-valued logic + drive-strength tri-state buses 2026-06-05 02:18:47 -03:00