Click Here To Go To The Your Computer Archive

Written By Fintan Culwin

Cover Art
Click Here To Enlarge Loading Screen

Loading Screen
Click Here To Enlarge Opening Screen

Opening Screen
Click Here To Enlarge Screenshot

Game Screenshot


Fintan Gulwin with a quick change on the BBC

When lecturing, I often include informal definitions of computing terms to make them more memorable to students. My informal definition of a utility is a program which makes life easier for an operator or a programmer. The utility presented here falls into the latter category. This machine-code program does nothing that cannot be done from Basic; but it does it much faster and with much less bother to the programmer.

The utility is designed to manipulate the colour attributes of a BBC's mode 7 screen. A simple call is included to invert the colours - excluding black and white; a more involved series of calls will select an area of the screen to be affected, and allow a more precise exchange of attributes. All of this could be done from Basic; but would involve the program keeping track of the position and nature of teletext control codes. The memory involved for this may be greater than the memory occupied by this utility; and it would certainly execute more slowly.

Teletext - mode 7 - screens have colour and other attributes set and controlled by character codes in the range 129 to 159 Ascii. A control code on a line will control the manner in which succeeding characters on that line are presented by the hardware. Such codes only affect the current line up to either the end of the line or an overriding code on the same line.

An example may make this clearer; suppose the message "HELLO!" is required to be presented in red text. The red text control code is given in the user guide as Ascii 129 (page 486). This can be incorporated into a string by the command:

string$ = CHR$(129) + "HELLO!"

When this string is printed onto a mode 7 screen the control code will occupy one character position and the text will follow it in red. The colour will be changed by a following colour code or by the end of that line. If it is wanted to change the colour from red to blue; it is only necessary to change the control code from red text - 129 - to blue text - 132. It is not necessary to rewrite the text itself.

The utility presented here, if called without any parameters will cause a predefined change in text and graphic colour attributes. These predefined changes are red to green and vice versa, yellow to blue and cyan to magenta and vice versa. White codes are not affected.

The default of the whole screen can be modified by adding four integer parameters to the call. These parameters define an area of the screen in the order leftX, rightX, topY and bottomY. Only the codes in this area will be changed; but the effects of the codes may extend to the right of the area.

More selective control of the changes can be made by specifying two or six integer parameters. Two parameters indicate a code to be found and a code to replace it. These codes are not limited to teletext control codes; any Ascii characters can be exchanged. Two integer parameters will effect the whole screen; six will select an area of the screen. The first four define the area as before; the last two specify the codes to be found and replaced respectively.

Only a limited error checking is provided. A check is made that the machine is in mode 7; and a check is made that the correct nns only. The left/right and up/down should be in the correct order and within the confines of the screen. If these conditions are not adhered to unexpected and possibly disastrous results will be obtained.

For the non technical all that is necessary is to copy out the listing. It is configured for tape based systems to occupy memory from &D00 onwards; it extends beyond the normal start of user memory &E00; so it will have to be protected or assembled for a different area. When run the code is first assembled and then tested with all four possible types of command. Once tested the start, end and execution addresses are displayed allowing a working copy to be saved.