Grafik-FORTH

Medium
Disk
Year
1990
Publisher
RAI Production (sold through German mail-order)
Type
Language
Category
fig-FORTH with built-in high-speed hi-res graphics (German)
Developer
Rainer Hansen
Language
fig-FORTH / 6502 assembly
Requirements
64K Atari XL/XE (graphics code lives in the RAM under the OS ROM); disk drive; Epson-compatible printer optional
Photocopied German manual cover: a circle labelled 'Grafik-FORTH – Copyright 1990 by RAI Production' surrounded by line-drawn shapes and fill patterns, above the slogan 'Die Zukunft hat begonnen!'

Overview

Grafik-FORTH ("Graphics FORTH") is a German FORTH system from 1990 by Rainer Hansen, released under his RAI Production label. Hansen described it not as a simple bundle of the public-domain fig-FORTH 1.4S and his Turbo-Graphics-System 256, but as a new language built from the two. Its selling point is very fast high-resolution graphics, using drawing routines that work independently of the Atari OS and rely heavily on lookup tables. He chose FORTH, he wrote, because it runs 10 to 100 times faster than BASIC, needs about a quarter of BASIC's memory and is easy to extend.

It has no connection to Paul Lutus's GraFORTH for the Apple II, despite the similar name. The German manual is not a FORTH tutorial. It points readers to Leo Brodie's Programmieren in FORTH and In FORTH denken and to E. Flögel's FORTH-Handbuch and FORTH on the ATARI, and concentrates on what is special about this version. Grafik-FORTH was later sold through a German mail-order house until its licence lapsed, after which it disappeared from the catalogue.

The package

The program came on several disk sides:

  • Side 1: the full system, which boots to a title screen (press START to begin), with sample blocks.
  • Side 2: a cut-down version that leaves more free memory, plus error messages, the full-screen editor's source, sprite and fill-pattern construction words, constants for the graphics entry points, slower "safe" graphics words, and turtle graphics (TURTLE, TURN, DRAW, TPLOT, with SIN/COS returning values ×10000).
  • Side 3: a 1050 Turbo speed-up, a Sieve of Eratosthenes benchmark, a sprite demo, a fill-pattern demo, words to load and save pictures, and five sample pictures.
  • A disk of plain fig-FORTH 1.4S and a DOS 3 disk with a helper program (BEREICH) for moving picture files across.

Like most FORTHs it stores programs in 1K blocks rather than DOS files: 90 blocks on a single-density disk, 130 in medium density, 179 in double density and 359 on a double-sided disk. Hansen notes that this gives 3K more space than DOS 2.5 in medium density and is faster too. A Percom block configures drives that support it, such as upgraded 1050s and the XF551. Words handle autostart (store a word's address in AUTO), MAKEBOOT writes the current system to a boot disk, and colours and screen settings can be set before saving. The manual also covers the editor's key commands and status line, an assembler vocabulary, error handling, and Brodie's DOER/MAKE construct for vectored words.

Graphics

All drawing words live in the GRAFIK vocabulary, and the routines themselves sit in the RAM hidden under the OS ROM. A program therefore brackets drawing with RAM (switch the OS out) and ROM (switch it back in), and must not call OS-based words such as ., EMIT, KEY or BLOCK in between.

GRAFIK EIN RAM 10 20 PLOT ROM
RAM 127 DUP 10 DUP CIRCLE ROM
RAM 100 120 21 GRAFIK FILL ROM

(These examples are from the manual: plot a point, draw a circle of radius 10 at the centre, then flood-fill with pattern 21. Note that FILL has to be qualified with GRAFIK, because the FORTH vocabulary has its own FILL.)

  • EIN opens a high-resolution graphics screen with four text lines underneath, and AUS returns to text mode, like GRAPHICS 0. WINDOW sets which line of the larger bitmap appears at the top, and pictures in Grafik-FORTH's own format have 256 lines.
  • COLOR 0, 1 or 2 erases, sets or XORs pixels for PLOT, LINE, DRAWTO, BOX, CIRCLE, TEXT and SPRITE.
  • CIRCLE draws circles and ellipses with separate x and y radii, wrapping at the screen edges, and FILL floods an area with one of 32 8×8 patterns.
  • SPRITE draws one of sixteen 16×16 software sprites, and drawing it again in XOR mode erases it. The manual shows how to wait on VCOUNT to stop flicker.
  • TEXT prints strings into the bitmap in 40-column, 80-column narrow or double-height styles. CROSS and CUR give a joystick- or keyboard-driven cross-hair cursor for drawing programs.
  • HCOPY dumps the whole 320×256 bitmap to an Epson-compatible printer at 72 dpi.

GRAPHICS 8 pictures from other programs (such as Design Master) can be converted from DOS 2 files and loaded with GET BILD by setting the line count to 192.

Using it today

Grafik-FORTH is a curiosity of the late German Atari scene. Because its graphics depend on RAM under the ROM, run it as a 64K XL/XE (PAL) in Altirra or atari800 with BASIC disabled. Keep blank FORTH-format disk images for your own blocks, since FORTH blocks are not DOS files. Without German, the word reference at the back of the manual and the demo blocks on side 3 are the quickest way in.

Credits