Coloured Text Panels
by Barry Christie

Note: This program selects mode 15 before running.

Running !SlabDraw runs a demonstration program, SlabDemo, that repeatedly draws random coloured slabs. SlabDemo uses the Slab Drawing module via a number of procedures.

The module provides three star commands. *InitCode <address> tells the module where the parameters to the other two commands will be stored (<address> is in decimal, not hex). SlabDemo uses PROCinitslab to call *InitCode with the address of the Basic integer variable A%. Thus the parameters for the other commands can be held in Basic's integer variables.

The other commands are *SlabColr, which determines the colour, and *ShowSlab, which draws a slab. SlabDemo calls these two commands via PROCslabcolr and PROCslab respectively.

*SlabColr sets the colour to the value held in A%. The range of possible values is 0=Grey, 1=Blue, 2=Violet, 3=Green, 4=Turquoise, 5=Red, 6=Gold. *ShowSlab draws a slab with its bottom left hand corner at A%,B%, width C% and height D%, where the screen is taken as being 80 units by 64. If E% is 1 then the slab is drawn sunken, otherwise it is drawn raised.

If you wish to use the module from Basic, you will probably find it convenient to copy PROCinitslab, PROCslabcolr and PROCslab into your program, rather than to use the module directly.

The module is saved as SlabModule, while its source code is saved as SlabDraw. To copy the module, hold down Shift and double click on !SlabDraw to open the directory viewer, then drag SlabModule out of it. Note that the module works in mode 15 only.
