RiscPCdem    Colour tests for your Risc PC

by David Spencer


It's a fair guess that one of the first things that you are going to want to do after unpacking your brand new Risc PC, is play with all those new screen modes and colours it offers, and show it off to your friends. These programs, from the article Using Colour on the Risc PC in this month's RISC User (7:7) demonstrate how to use the new modes and colours, and give some simple programs that show just what the machine is capable of. A directory display showing the programs can be opened by double-clicking on the the !RiscPCdem icon, or its icon in the RISC User menu system.

USING ALL THEM COLOURS
To show what all these colours can do, there are two programs on the disc which draw horizontal bars for the primary and secondary colours; red, green, blue, magenta, cyan, yellow and white, in 256 graduations from black to full intensity. This is only actually achievable in 16 million colour modes, although the use of ColourTrans by Basic ensures that in other modes the results are the best they can be. The program ColourBars runs through 16, 256, 32000 and 16 million colour modes to demonstrate this point. Before running this, you should change into a 16 million colour 800  600 mode in the Desktop to ensure that there is enough free memory, because MODE will default to a lower colour depth and spoil the effect if it can't claim enough RAM. Double-click on ColourBars to run it. To operate successfully, the program needs 2Mb of VRAM. If you have no VRAM, you will not be able to use 16 million colours. If you have only 1Mb, you can double-click on the program ColourBar1 instead which will give the same effect, but at a lower resolution. If you are running this version of the program, you should first change to an 800  600 32 thousand colour mode.

WHAT MODE AM I IN?
Obviously, there are times when a program might like to find about the current screen mode. This can be done in Basic by using MODE as a function which returns a pointer to a block of memory holding information about the mode. The procedure PROCmodeinfo in the file ModeProcs will return the screen resolution in both pixels and OS units, and the number of available colours. The procedure returns the information by way of five variables passed to it, these holding the X and Y pixel resolutions, the X and Y OS Unit resolutions and the number of colours respectively.

RESTORING THE SCREEN MODE
The changes to the new operating system mean that when a Basic program uses a mode specifier string, as described in the article, to change mode, it will also cause the Wimp screen mode to be changed. It is also no longer possible to use Basic statements such as:
	m%=MODE
to find the information required to return to the screen mode that was in use when the program started, since the concept of mode numbers no longer exists. The procedures PROCsavemode and PROCrestoremode in the file ModeProcs can be used to ensure that a Basic program sets the screen mode back to its former state when the program finishes. You should call PROCsavemode before changing mode and when your program exits, you should call PROCrestoremode.


 Copyright RISC User 1994
