Graphics Processor

Overview

The Graphics Processor is an optional NCS/e expansion module providing geometric drawing operations for compatible displays.

Rather than maintaining its own framebuffer, the Graphics Processor converts geometric primitives into character writes and renders them directly through the display peripheral.

Programs using these verbs require a compatible Graphics Processor and display to be installed.


Display

The Graphics Processor operates on a canonical 32 × 12 character canvas.

Coordinates are absolute, with the origin at the upper-left corner of the display.

Axis Range
x 031
y 011

Graphics outside the visible canvas are clipped. Coordinates do not wrap around the edges of the display.

Drawing uses the display's current colour.

Drawing characters

Drawing operations accept an optional character used to render the shape.

If omitted or supplied as an empty string, the full block character () is used.

-- Draw using the default full block.
GFX.LINE 0 0 31 11

-- Draw using a custom character.
GFX.LINE 0 0 31 11 "*"

Cursor behavior

Graphics operations render through the display's character drawing interface and modify the display cursor while drawing.

The cursor position after a graphics operation is unspecified and must not be relied upon.

Programs that require a particular cursor position should explicitly reposition it after drawing.

GFX.RECT 2 2 20 8

D.CUR 0 11
D.TXT "READY"

Lines

GFX.LINE — Line

GFX.LINE <x1> <y1> <x2> <y2> [char]

Draws a line between two absolute display coordinates.

GFX.LINE 0 0 31 11

Rectangles

GFX.RECT — Rectangle

GFX.RECT <x1> <y1> <x2> <y2> [char]

Draws the outline of a rectangle between two absolute display coordinates.

GFX.RECT 2 2 20 8

GFX.RECTF — Filled Rectangle

GFX.RECTF <x1> <y1> <x2> <y2> [char]

Draws a filled rectangle between two absolute display coordinates.

GFX.RECTF 2 2 20 8

Circles

GFX.CIRCLE — Circle

GFX.CIRCLE <x> <y> <radius> [char]

Draws a circle centered on the specified absolute display coordinate.

GFX.CIRCLE 16 6 5

GFX.CIRCLEF — Filled Circle

GFX.CIRCLEF <x> <y> <radius> [char]

Draws a filled circle centered on the specified absolute display coordinate.


Ellipses

GFX.ELLIPSE — Ellipse

GFX.ELLIPSE <x> <y> <rx> <ry> [char]

Draws an ellipse centered on the specified absolute display coordinate.

GFX.ELLIPSEF — Filled Ellipse

GFX.ELLIPSEF <x> <y> <rx> <ry> [char]

Draws a filled ellipse centered on the specified absolute display coordinate.


Triangles

GFX.TRI — Triangle

GFX.TRI <x1> <y1> <x2> <y2> <x3> <y3> [char]

Draws the outline of a triangle between three absolute display coordinates.

GFX.TRIF — Filled Triangle

GFX.TRIF <x1> <y1> <x2> <y2> <x3> <y3> [char]

Draws a filled triangle between three absolute display coordinates.


Filled operations

Where provided, the F suffix identifies the filled form of a drawing operation.

For example:

GFX.RECT    Rectangle outline
GFX.RECTF   Filled rectangle

GFX.CIRCLE  Circle outline
GFX.CIRCLEF Filled circle

Filled operations follow the same coordinate, clipping, character, and colour behavior as their outline counterparts.