Acorn User


Graphics Extension ROM

Author: Malcolm Banthorpe
Publisher: Acornsoft
Machine: BBC Model B

 
Published in Acorn User #041

Great For Graphics

Graphics Extension ROM

Acornsoft's long-awaited Graphics Extension ROM has now been released and those who have been waiting are not likely to be disappointed. It is effectively a 16K extension to the Operating System of the BBC Micro and the facilities offered fall into two categories. First, and probably of most interest to serious graphics programmers, it offers enhanced shape plotting, flood-fillings and the ability to move or copy part of the screen. Second, there is a substantial sprite package with which, it is claimed, arcade-style games can be programmed in Basic.

Apart from a few * commands, the ROM makes use of many of the previously unassigned PLOT codes, VDU codes and GCOL statements. These have the advantage over the * commands generally used to access sideways ROMs in that parameters can be passed to them from Basic in the form of numbers, variables, expressions or functions. Access to the ROM is also possible from any other language which supports graphics and from Assembler via the OSWRCH vector. The manual states that the ROM is compatible with all current Acorn second processors.

I was struck by the speed at which it operates. If you've seen an Acorn Bitstik drawing system in operation you'll have some idea of the speed shown in the flood-fill, circle, arc and other shape plotting operations. This ROM has the advantage over Bitstik that it will work in any of the graphics modes.

The ROM is, by default, inactive until called with the command, *GXR. This command also reserves the three pages of memory that it normally requires for workspace. In other words, if you have a standard BBC Micro with an Acorn disc filing system, you'll find that PAGE is reset to &1C00. Flood-filling uses two of these pages and, if this facility is not required, they can be reclaimed with the command *NOFLOOD. *FLOOD restores it.

The general method of using the new shape plotting commands involves MOVEing to either one or two key locations followed by a PLOT, with the appropriate code, to a further location. To draw a circle, you MOVE to the centre and then PLOT a point on the circumference.

Ellipses are defined by three locations: the centre point, the outermost point (left or right) at the same height as the centre, and the highest or lowest point of the ellipse. This allows ellipses to be drawn at any angle.

Any of the filled shapes can be drawn either with the normal solid colours available in the current graphics mode or with a predefined pattern of pixels. New colours can be generated by 'dithering' combinations of different coloured pixels; for example, red and magenta give a deep pink.

There are four pixel patterns immediately available at any time, selected by GCOL16, GCOL32, GCOL48, GCOL64. If the second parameter in the GCOL statement is between 0 a 127 it defines a foreground pattern; 128 to 255 defines a background. As well as four patterns available by default, new pixel patterns can be defined using VDU 23,[2-5] followed by eight bytes. The eight bytes required to produce a particular pattern in a given graphics mode theoretically requires a knowledge of the way in which the colours are stored in that mode. This is explained in some detail in the manual but the task is greatly simplified by a pattern editor program supplied on the cassette. Lines can also be drawn using these colour patterns, the exact effect being dependent upon the angle of the line. The same patterns can be used by the flood-fill commands to fill any enclosed outline shape.

PLOT codes &10 to &1F and &30 to &3F expand upon the simple dotted lines offered by the standard operating system by drawing lines in a predefined dot-dash pattern. VDU23,6 followed by eight bytes sets up a dot-dash pattern and the particular PLOT code used defines how the line will be drawn - whether the first and last points are drawn or omitted and whether the pattern is continued or restarted at the beginning of a new line.

The move and copy facility allows a rectangular region of the screen, defined by two MOVEs, to be either moved or copied to elsewhere on the screen. Again, the speed is impressive and will be much appreciated by anyone who has used conventional routines to redraw part of the screen pixel by pixel. In fact, the speed is sufficient to allow these commands to be used as a form of animation; a large area of screen can be repeatedly repositioned quickly and smoothly.

The manual supplied was only a provisional version but shows evidence of the normal high standard of documentation associated with Acornsoft products. Each type of commands is carefully explained and examples of its use are given. A cassette contained program examples and demonstrations accompanies the package. It also has a drawing program which makes good use of the new commands.

Sprites, when required, make a further demand on memory to store their definitions. *SSPACE n reserves n pages of sprite memory. *SEDIT N then calls the sprite editor so that sprite number N can be designed or, if it already exists, modified. The editor's facilities are fairly extensive, including horizontal and vertical mirroring and the ability to flood a row or column with colour.

An interesting alternative way of creating sprites allows any rectangular area of screen to be captured and henceforth used as a sprite. Examples of the many ways of using sprites for animation are included in the manual and on the cassette.

Altogether this is one of the more impressive of the many sideways ROMs currently available. Inevitably there are facilities not included that some people would find desirable. For my own part, I would be prepared to sacrifice the sprites for general scaling and rotation commands. Nevertheless it does vastly increase the graphics potential of the BBC Micro. Apart from offering speed that would be difficult to match and despite its workspace requirements, it should free more programming memory in the higher resolution graphics modes on a standard machine, since procedures for primitive functions such as circles and filling will no longer be required.

The manual received does not mention whether the ROM is compatible with the shadow screen memory of the B+, although it does imply that it will work with an Aries B20 board.

If you're into graphics and can find room for one more ROM, this has got to be the one.

Malcolm Banthorpe

Other BBC Model B Game Reviews By Malcolm Banthorpe


  • Hershey Characters Font Generator Front Cover
    Hershey Characters Font Generator
  • Airbrush Front Cover
    Airbrush