feat: run the full QB45 EXAMPLES suite (23 programs) oracle-verified
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 3 Sep 2026 20:13:51 +0000 (23:13 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 3 Sep 2026 20:13:51 +0000 (23:13 +0300)
commit24c8c9e56917d0de28dec405735e032c6b54776e
tree6728019dabf4f0113a15c25e39b3084ada8b4e9d
parentbe603d0b0155edd2d89421d35b849cbfba065cf4
feat: run the full QB45 EXAMPLES suite (23 programs) oracle-verified

Implements every language feature the classic QuickBASIC 4.5 example
programs (qbasicapps/QB45/EXAMPLES) exercise, verified pixel- and
byte-exact against QB.EXE /RUN under DOSBox (xdotool-driven key
scripts, DOSBox Ctrl-F5 captures as ground truth):

- Records: TYPE/END TYPE, fixed STRING*n fields, member access
  (x.field), arrays of records, LEN(recvar) = record byte size
- Files: OPEN FOR BINARY/RANDOM with LEN=n and bare channel numbers,
  FIELD, typed GET/PUT, SEEK statement/function, LOF, LOC, FREEFILE
  (bare form too), INPUT$(n,#ch), DOS-absolute paths resolve against
  the emulated drive root, INPUT$/GET/SEEK on text channels via lazy
  byte handle
- Statements: EXIT FOR/DO/SUB/FUNCTION, STATIC procedures (SHARED
  names resolve to module scope before static locals), LINE INPUT
  "prompt",var, MID$ assignment, PRINT USING (numeric field width =
  spec char count), NAME, KILL with DOS wildcards, SHELL "DIR > file"
  (WHEREIS.BAS-compatible 8.3 listing), ERR error codes, COMMAND$,
  INSTR, &H&/&O& long-suffixed literals, OPEN COM1 null-modem
- Graphics: WINDOW / WINDOW SCREEN (plain form is Cartesian),
  graphics VIEW with border that survives plain CLS, PMAP, DRAW macro
  language (U/D/L/R/E/F/G/H, M, B, N, C, S, TA, P), PALETTE /
  PALETTE USING, CLS 0/1/2, full 5-slot LOCATE, LINE -STEP and
  16-bit dash style, pattern-string PAINT, PRESET; CIRCLE under
  WINDOW keeps y-radius visually round (mode aspect, not y-scale);
  PUT under a Cartesian WINDOW anchors the region's logical top-left;
  same-mode SCREEN page flips preserve video memory
- Input: ALT+letter reaches programs as CHR$(0)+BIOS scancode
  (KeyboardQueue VK_ALT_BASE scheme)

Verified: BALLPSET, BALLXOR, BAR, CAL, CHECK, COLORS, CRLF, CUBE,
EDPAT, ENTAB, FILERR, FLPT, INDEX, MANDEL, PALETTE, PLOTTER,
QLBDUMP, SEARCH, SINEWAVE, STRTONUM, TERMINAL, TOKEN, WHEREIS —
screenshots match the oracle (many pixel-identical), file outputs
(CRLF TEST.BAK, ENTAB OUT.TXT, INDEX STOCK.DAT) byte-identical.
TERMINAL also hits "Device timeout" in DOSBox itself (no COM1) —
environment limit, not a program bug. 93/93 tests green.
Documentation/language/index.org updated with all new statements.
12 files changed:
Documentation/language/index.org
src/main/java/eu/svjatoslav/crtbasic/ast/Ast.java
src/main/java/eu/svjatoslav/crtbasic/frontend/SwingFrontend.java
src/main/java/eu/svjatoslav/crtbasic/input/KeyboardQueue.java
src/main/java/eu/svjatoslav/crtbasic/interp/Interpreter.java
src/main/java/eu/svjatoslav/crtbasic/lexer/Lexer.java
src/main/java/eu/svjatoslav/crtbasic/parser/Parser.java
src/main/java/eu/svjatoslav/crtbasic/video/DefaultPalettes.java
src/main/java/eu/svjatoslav/crtbasic/video/Framebuffer.java
src/main/java/eu/svjatoslav/crtbasic/video/TextConsole.java
src/main/java/eu/svjatoslav/crtbasic/video/VgaDevice.java
src/test/java/eu/svjatoslav/crtbasic/drivers/GameDriver.java