Beebug
1st December 1985
Author: Mark Sealey
Publisher: Acornsoft
Machine: BBC Model B
Published in Beebug Volume 4 Number 7
If you want to transform your graphics displays then Acornsoft's long-awaited Graphics Extension ROM could be the answer. Mark Sealey has been putting the ROM to work.
Graphics Extension ROM (Acornsoft)
Acorn's Graphics Extension ROM (GXR) provides a set of additional graphics commands for spectacular, new and easy shape drawing and filling, copying and moving areas of the screen, and a variety of shadings. In addition, Acorn have provided a sprite graphic utility.
Unlike Computer Concepts' Graphics ROM which used a variety of new * commands, GXR mainly uses the PLOT extensions which, until now, had the famous 'for future expansion' description, and provides new VDU23 and GCOL parameters.
Any language that supports the PLOT, GCOL and VDU commands can make use of these routines provided the GXR ROM is installed and activated. It is 6502 Second Processor compatible and will also work on the Electron as well as with the Aries B-20 RAM Board. However, for use with the B+, a special version of the GXR is available.
The ROM is activated by *GXR and can be turned off by *NOGXR. A rather hefty three pages of RAM are lost when the ROM is activated so PAGE is reset to &1C00 on a disc system. Other * commands available from within the ROM are an online HELP list of the codes, the sprite controls, and a *FLOOD/NOFLOOD option. Use is also made of *FX163.
Supplied with the package are example programs on cassette with a special tape-to-disc transfer utility. The copy of the pre-release manual was up to Acorn's usual standard in its clarity. Each section begins with a diagram of a sector, arc, ellipse or whatever, explains the simple codes to achieve the effect and then gives longer examples.
The PLOT calls (with the exception of the Copy routines) follow the old pattern of coding described on page 319 of the BBC User Guide (i.e. 1 is current graphics foreground, 2 relative logical inverse colour, etc.). PLOT may now take codes between 88 and 248 as its first parameter, to draw and/or fill, rectangles, parallelograms, circles, ellipses, arcs, segments and sectors.
For example, using the old way to fill a rectangle with two filled triangles (two MOVE and two PLOT instructions) is prone to mistakes and about twice as slow as the new method:
MOVE 200,800 :REM top left corner
PLOT 101,700,200 :REM bottom right.
To draw a filled ellipse (hitherto requiring almost advanced qualifications in geometry (see Beebug Workshop in Vol. 4 No. 3), you simply MOVE to the centre, MOVE to the right-hand point or wider radius, and PLOT (with first parameter in range 200-207) the top (or narrow radius). This gives an almost instantaneous block fill.
Many of these extended routines will be useful as utilities in, say, pie-chart routines for extended software written in Basic and really are impressively fast - presumably as it accesses the OS directly (hence the ROM's own version number, 1.2).
Pattern And Shading Styles
It has long been known that the GCOL command is capable of extension beyond what is outlined in the User Guide. Only months after the BBC micro's appearance, Gaelsett released their Extended Graphics utility on tape. Now Acorn's own ROM takes colour mixing to its limits by pixel/bit manipulation (using VDU23). It must be said that whilst the commands are within the true tradition of BBC Basic, they are very user unfriendly:
VDU 23,2,&1D,&23,&1D,&23,&1D,&2A,&1D,&2A
This redefines GCOL 16,3 in mode 2 to give a white and green stippled mix. A virtually infinite mixture of colours and hues is possible, and well demonstrated in the examples supplied. Some understanding of how the BBC micro handles pixels is essential to make the most of this facility, but the principles are well explained in the manual. All the options are there, if you seek them out. It is also possible to extend the ways in which flood fill works, chiefly by setting the conditions which determine when it will stop - which fore or background colour, etc. Again, it is a very versatile and fast set of commands.
Copying and/or moving any area of the screen to any other position could not be easier. You first mark with two co-ordinates (bottom-left, top-right) the area to be copied from. Then PLOT (range 184-191), newx, newy where it is to be moved to.
Included in the example programs is a fairly simple CAD package that makes use of most of the facilities contained in the ROM. More sophisticated drawing programs abound, but the fact that this one is written in Basic and yet still plots, draws and fills so quickly is evidence of the Graphics ROM's own in-built speed.
The final feature of the Extension ROM is a sprite facility. It allows you to design and edit up to 256 sprites (with PAGE still at &800 with a Second Processor). Each can then be driven from Basic by selecting it as number n: *SCHOOSE n followed by PLOT (range 204 to 211) and its x,y co-ordinates. A sprite is loaded and saved as a block of memory, and a very impressive feature is that of defining (another VDU 23 command) any area of the already plotted screen and actually moving this as a sprite.
The GXR's drawing commands for circles, ellipses, and so on are also available on Computer Concepts' Graphics ROM. However, this does not allow the easy passing of variables to the extra graphics commands as does GXR. In addition, although GXR has no text angling and enlarging facilities nor turtle graphics, its colour mixing and character filling abilities more than make up for this.
Now for the bad news. Whilst using the Graphics ROM, it behaved perfectly but there was a definite clash with Wordwise Plus, causing this to do all sorts of unlikeable things. I understand that this is because the latter makes use of *FX163 calls reserved for Acornsoft ROMs. It is a major drawback for users of both and it remains to be seen whether Computer Concepts can modify this excellent word processor to avoid these clashes.
However, this long-awaited ROM is cheap as ROMs go and makes fill, draw, copy and shade/colour routines both easy and very quick, using already familiar commands. Imagination - as they say - is the only limitation.
Other BBC Model B Game Reviews By Mark Sealey
Scores
BBC Model B VersionOverall | 78% |