VDU 28

From BeebWiki
Jump to: navigation, search

Defines the text window.

VDU 28
Syntax VDU 28,<numeric>,<numeric>,<numeric>,<numeric>
Character stream (hex) 1C <left> <bottom> <right> <top>
Description Confines subsequent text to a rectangular window with the specified coordinates.


The Acorn text window coordinate system.

VDU 28 defines a rectangular text window inside which all future text will be printed. The screen contents are not changed.

The window limits are specified in the order left, bottom, right, top. They can also be read as the X and Y coordinates of the bottom left point, followed by those of the top right point of the window.

The distances are measured in character cells, and always from the top left corner of the screen. The size of the character cells, and thus the window's position on the screen, depends on the MODE. The top left corner of the window becomes the 'text origin', from which POS, VPOS and PRINT TAB positions are measured.

The window borders are inclusive. If one enters, for instance:

VDU 24,20,23,34,4

then the text window includes columns 20 to 34 and rows 4 to 23.

Defining even a full-screen text window disables the fast CLS routine and replaces hardware scrolling with software scrolling. Very large windows can make printing noticeably slower in graphics MODEs.

Commercial software often uses three-line text windows while loading from tape, so that the Cassette Filing System only displays its current status and the name of the file being loaded.

The text window is reset by VDU 26 or MODE.