feat: add GOSUB/RETURN, CONST, SWAP, WIDTH, ELSEIF, and screen capture
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 22 Aug 2026 10:28:41 +0000 (13:28 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 22 Aug 2026 10:28:41 +0000 (13:28 +0300)
commit9a2e354c3d4a19ce9069376e8f1c465aac7350d3
tree2830524cf6042254e401c1fffd5013a6d4a7db54
parent8083566def7e2006687634ceac5a4f1bb33966a5
feat: add GOSUB/RETURN, CONST, SWAP, WIDTH, ELSEIF, and screen capture

- Language: GOSUB/RETURN (nested calls, same-block labels), CONST
  module-level constants, SWAP for scalars and array elements, ELSEIF
  chains in block IF, and bare parameterless FUNCTION calls.
- WIDTH statement for SCREEN 0: 80x25, 40x25 (double-wide glyphs) and
  80x50 (8x8 font) text grids; clears the screen like the original.
- PAINT gets classic border semantics: fills every reachable non-border
  pixel instead of confining to the seed color; off-screen seeds clip.
- INPUT # follows classic delimiters: numbers split on comma, space or
  newline; strings on comma/newline with quotes stripped; empty slots
  read as 0 / ""; statements may share and span lines.
- VIEW PRINT now confines printing and scrolling to the band; bare
  VIEW PRINT restores the full screen.
- New capture package: ScreenRecorder samples the visual page at 30 Hz
  into a lossless XOR-delta+deflate .crtrec; CrtrecEncoder pipes raw
  frames to ffmpeg (H.264, CRF 18 with a VBV cap). Swing frontend:
  F12 screenshot, Shift+F12 recording, background transcode queue that
  drains before exit; --encode CLI re-encodes a recording later.
- Docs: README.org replaced by AGENTS.org (agent operating guide);
  language reference updated for the new statements and semantics.
17 files changed:
AGENTS.org [new file with mode: 0644]
Documentation/language/index.org
README.org [deleted file]
src/main/java/eu/svjatoslav/crtbasic/Main.java
src/main/java/eu/svjatoslav/crtbasic/ast/Ast.java
src/main/java/eu/svjatoslav/crtbasic/capture/CrtrecEncoder.java [new file with mode: 0644]
src/main/java/eu/svjatoslav/crtbasic/capture/ScreenRecorder.java [new file with mode: 0644]
src/main/java/eu/svjatoslav/crtbasic/frontend/SwingFrontend.java
src/main/java/eu/svjatoslav/crtbasic/interp/Interpreter.java
src/main/java/eu/svjatoslav/crtbasic/parser/Parser.java
src/main/java/eu/svjatoslav/crtbasic/video/TextConsole.java
src/main/java/eu/svjatoslav/crtbasic/video/VgaDevice.java
src/main/java/eu/svjatoslav/crtbasic/video/VgaFont.java
src/main/resources/fonts/README.txt [new file with mode: 0644]
src/test/java/eu/svjatoslav/crtbasic/interp/HackerBasTest.java [new file with mode: 0644]
src/test/java/eu/svjatoslav/crtbasic/interp/InterpreterFeaturesTest.java
src/test/java/eu/svjatoslav/crtbasic/video/VgaDeviceTest.java