VDU 19
by Andrew Daines
from Your Computer, January 1985

THESE MACHINE-CODED routines are designed to emulate the VDU 19 command found
on BBC and Electron computers. The first routine performs a universal INK
change without disturbing the text already on the screen. It will not search
for and replace any colour but it will change all the text to blue, for
example. The second routine is similar to the first but changes the PAPER
colour instead of the INK; again this routine leaves any text unchanged.
After this comes the third routine, this is more complex than the previous
two. It searches through the text and if it finds a certain INK colour it will
change it to another; again this leaves all text unchanged. Finally comes the
fourth routine which searches through PAPER colours and if it finds a
specific colour it changes it.

Now you know exactly what each routine does you must type them in. First type
in and run the program provided. This will ask you for the address you want
the machine code to start from, on a 16K machine 30000 is a good origin and
60000 on a 48K machine. When this address has been entered ten more addresses
will be displayed, the meanings of which are given here:

Address 1: POKE this with the new INK colour.
Address 2: RANDOMIZE USR for routine one.
Address 3: POKE this with the new PAPER colour.
Address 4: RANDOMIZE USR for routine two.
Address 5: INK colour to search for.
Address 6: New INK colour.
Address 7: RANDOMIZE USR for routine three.
Address 8: PAPER colour to search for.
Address 9: New PAPER colour.
Address 10: RANDOMIZE USR for routine four.
Addresses 1 and 2 refer to routine one.
Addresses 3 and 4 refer to routine two.
Addresses 5, 6 and 7 refer to routine three.
Addresses 8, 9 and 10 refer to routine four.

After printing these addresses the program will proceed to POKE the machine
code and after a few seconds you will either see the message "Code O.K...."
in which case you can SAVE and VERIFY the code or the message, or "Checksum
error : Check DATA" which means that you have mis-typed one or more of the
numbers and the program will stop, allowing you to check and rectify the data.
When you are satisfied the data is correct, re-run the program. The BASIC
program will then re-new itself, you can then type:
	CLEAR ST-1
where ST is the origin. And then type LOAD "" CODE and load back the machine
code in memory, then you are free to use the routines.
