velxio/frontend/src/simulation/parts
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
..
ActiveParts.ts
BasicParts.ts feat(motors): fix stepper rotation + add A4988 driver (real Fritzing SVG) 2026-05-31 16:28:34 -03:00
ChipParts.ts feat(sim): Phase 5 — migrate 74HC595 shift register to PinResolver 2026-05-15 18:23:10 +02:00
ComplexParts.ts fix(joystick): map wokwi-analog-joystick direction (-1/0/+1) to ADC voltage 2026-05-22 18:57:26 +02:00
CustomChipPart.ts feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
EPaperPart.ts
LogicGateParts.ts feat(sim): Phase 5 — migrate every logic-gate handler to PinResolver 2026-05-15 18:19:00 +02:00
MotorDriverParts.ts feat(motors): fix stepper rotation + add A4988 driver (real Fritzing SVG) 2026-05-31 16:28:34 -03:00
PartSimulationRegistry.ts test(sim): Phase 1d-tests J + C — vitest.config.ts + components-metadata integrity 2026-05-15 22:58:12 +02:00
ProtocolParts.ts Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
SensorParts.ts feat(motors): fix stepper rotation + add A4988 driver (real Fritzing SVG) 2026-05-31 16:28:34 -03:00
index.ts feat(motors): fix stepper rotation + add A4988 driver (real Fritzing SVG) 2026-05-31 16:28:34 -03:00
partUtils.ts