Skip to content

Releases: IgnacioMonge/Shatranj

Shatranj 1.0 - Opening Move

25 Jun 12:28

Choose a tag to compare

Shatranj 1.0, Opening Move, is the first public release of the project: online chess for a real ZX Spectrum 48K, playable Spectrum-to-Spectrum or Spectrum-to-PC.

Downloads

  • SHATRANJ-1.0-spectrum.zip: Spectrum package. Keep SHATRANJ.tap, SHATRANJ.OVL, and SHATRANJ.DAT together.
  • Shatranj-Client-Setup-1.0.exe: Windows installer for the Qt PC client.

Highlights

  • Full ZX Spectrum 48K chess client with board UI, move entry, clocks, chat, move history, setup menus, status notices, draw/resign, reset/restart, check and checkmate flow.
  • Two play pairings: Spectrum vs Spectrum and Spectrum vs PC.
  • Two network modes: Direct TCP for reachable peers and MQTT for broker-mediated play across NAT/CGNAT.
  • Shared application protocol for game start, moves, ACK/NACK, chat, ping, reset, draw, resign, disconnect, and reconnect paths.
  • Qt PC client with board play, legal-target display, clocks, chat, RX/TX protocol log, Direct TCP and MQTT support.
  • Runtime setup for role, side/color policy, endpoint, port, room code, notation, board palette, piece set, and hints.
  • Three 16x16 Spectrum piece sets: BRRY, SPCY, and PIXL.
  • Five board palettes: Classic, Blue, Green, Cyan, and Magenta.
  • Spectrum chat length matched to the real two-line UI envelope, including side icon and timestamp.

Spectrum Build Notes

  • Target: real ZX Spectrum 48K.
  • Requires divMMC/esxDOS and an ESP-AT network link.
  • Uses a DAT asset pack for runtime UI/art data and 2 KB overlays for cold code paths.
  • Includes build guards for overlay size, overlay ABI, SDCC/IY contract, low-RAM layout, resident size, BSS, and stack margin.

Stability Work Included

  • Hardened Direct TCP receive handling, reconnect paths, HELLO/session handshake, and disconnect detection.
  • Hardened MQTT session IDs, room conflict handling, retained-payload recovery, keepalive, and publish acknowledgement paths.
  • Hardened Spectrum UART draining around overlay latency and short receive bursts.
  • Fixed remote move validation, promotion handling, game-start/reset/rematch edge cases, terminal status, check/checkmate presentation, setup rendering, status overlay rendering, and PC pending-state feedback.
  • Measured Z80 size and hot-path work across sprite blitting, screen address calculation, line rendering, keyboard scan, rules/SAN helpers, MQTT buffers, resident protocol/text paths, and overlays.

Known Limitations

  • Spectrum promotion UI supports queen promotion only in 1.0.
  • MQTT retained game-state restoration is not part of 1.0.
  • Direct TCP requires reachable peers; use MQTT when NAT/CGNAT prevents direct connectivity.
  • The Spectrum build remains a 48K target, so tight resident memory, overlay latency, and contended RAM are deliberate constraints.