Index


RISC World

StarPROG

Lawrence Granville re-opens an old favourite.

Well this month in StarProg we have four examples for you.

BallDemo3

This is one of the editors own demos and was originally written for an ARM2 machine running in mode 13. I have updated it so that it now works in Mode 28 (640x480) 256 colours. This is a good example of using bank screen switching to create animation. The program sets up 4 screen banks and on each frame draws a sphere into one bank. Because of the the careful way the single sphere is animated and the fact that the screens are not cleared on each redraw a vast number of moving spheres eventually appear. Also note the use of a mask on the logo image (which is plotted on every frame) so that you can see the spheres moving underneath. Also note the scrolltext at the bottom. Can you see how the scrolltext area is cleared every frame but the main screen area left intact?

Fig1
BallDemo3 in action

Note that to run this demo you will need 2Mb of VRAM. Before loading the demo drag the screen memory slider in the task display up to 2048K,

Roots by G. Kattau

A good mathematical demo. This works out the square root of any number to any number of decimal places. Although a very large number of decimal places can take a bit of time to work out (even on a StrongARM)!

Slider

Perhaps this might make the basis of a good screen saver. All it does is slide the entire screen around making a great big mess in the process. Unlike most demos of this type the computer actually stays usable while the sliding is happening! Try and find a window and drag it around to see what happens. To stop Slider simply hold down the Escape key. The screen will then return to normal.

Fig2
Slider in action

Tour by G. Kattau

The Knights tour problem, solved in Basic. Simply position the Knight anywhere on the board and the program will then try and move the knight so that it lands on every square of the board once. If it all happens too fast for you then you can single step through the tour to see the route the knight takes.

Fig3
Tour

What we want

That is it for this issue. I am still waiting for someone to use the graphics library supplied inside the !WarpSpeed demo from last month. Why not try and make your own demo using these general purpose routines. If you want StarPROG to continue then send in your contributions!

Lawrence Granville

 Index