[[file:crtbasic.png]]
*CRT Basic* is an interpreter for the BASIC programming language,
-written in pure Java. It runs classic =.bas= programs on a virtual
-VGA display: text mode, pixel graphics, palettes, multiple video
-pages, keyboard input and sound timing — the full environment that
-BASIC programs of the DOS era expect.
-
-The motivation is simple: BASIC programs from that era are a perfect
-playground for AI agents. They are small, self-contained, visual and
-interactive. *CRT Basic* is built so that an AI agent can *write, run,
-observe, interact with and test* BASIC programs with no human in the
-loop. Every program can run headless: the agent caps execution at N
-statements, dumps the screen to a PNG or as raw video memory bytes,
-injects scripted keystrokes, and
-reads program variables back out when the run finishes.
-
-The language implemented is the structured BASIC dialect that became
-widespread in the 1990s: no line numbers required, named
-SUB/FUNCTION procedures, =DO...LOOP=, =SELECT CASE=, typed variables,
-and the classic =SCREEN= graphics modes with =PSET=, =LINE=, =CIRCLE=,
-=PAINT=, =GET= and =PUT=. Compatibility with existing vintage programs
-comes as a practical side effect of implementing this dialect
-faithfully: many classic =.bas= games and demos run unchanged.
+written in pure Java. It runs classic =.bas= programs.
+
+You can find [[https://www3.svjatoslav.eu/projects/qbasicapps/][here collection of example BASIC programs]] that can be
+executed by *CRT Basic*.
* Quick start
:PROPERTIES:
:CUSTOM_ID: quick-start
:END:
+The interpreter requires Java JDK 21 or newer.
+
#+BEGIN_SRC sh
-cd /path/to/crtbasic
-./install.sh # installs to ~/.local (CRT_BASIC_PREFIX to override)
-crtbasic program.bas # interactive window
-crtbasic program.bas --headless --screenshot=out.png --raw=out.raw --steps=100000
-#+END_SRC
+ cd /path/to/crtbasic
+ ./install.sh # installs to ~/.local (CRT_BASIC_PREFIX to override)
-- With no options the program runs *interactively*: a Swing window
- shows the live screen (~30 fps) and key presses reach the program
- through =INKEY$= and =INPUT$=.
-- =--headless= (implied by =--screenshot= / =--raw= / =--steps=) runs
- with no window and dumps the screen afterwards — the agent-driving
- path. =--raw= writes the raw indexed pixels of every video page,
- suitable for byte-level comparison (see [[file:agent-integration/index.org][Agent integration]]).
-- =--steps=N= caps executed statements, so programs with endless game
- loops can be sampled deterministically.
+ crtbasic program.bas # interactive window
+#+END_SRC
-The interpreter requires Java 21 or newer. Building from source is a
-plain =mvn package=; see [[#building][Building and testing]].
* Architecture at a glance
:PROPERTIES:
- [[file:video/index.org][Video subsystem]] — the virtual VGA: modes, text, drawing, palettes.
- [[file:interpreter/index.org][Interpreter semantics]] — numerics, variables, scoping, RND, errors.
- [[file:agent-integration/index.org][Agent integration]] — headless runs, drivers, scripted play-testing.
+* Source code
+
+*This program is free software: released under Creative Commons Zero
+(CC0) license*
+
+*Program author:*
+- Svjatoslav Agejenko
+- Homepage: https://svjatoslav.eu
+- Email: mailto://svjatoslav@svjatoslav.eu
+- See also: [[https://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
+
+*Getting the source code:*
+- [[https://www2.svjatoslav.eu/gitweb/?p=crtbasic.git;a=snapshot;h=HEAD;sf=tgz][Download latest source code snapshot in TAR GZ format]]
+- [[https://www2.svjatoslav.eu/gitweb/?p=crtbasic.git;a=summary][Browse Git repository online]]
+- Clone Git repository using command:
+ : git clone https://www3.svjatoslav.eu/git/crtbasic.git