★ CODING ★ LISTINGS ★ TEST PATTERNS (AMSTRAD COMPUTER USER) ★ |
Test Patterns (Amstrad Computer User) | Coding Listings |
Ivor Spital - AMSTRAD There are six different display options, similar to those generated by TV test pattern generators used for aligning colour TV equipment. Lines 170 to 240 use INKEY$ to read a number from 1 to 6 from the keyboard (to select the option) and then branch to the appropriate routine. After the routine has been selected, the program will ‘hang' there as a result of the n GOTO n command which terminates each routine. The chosen pattern will then stay on the screen until the [ESC] key has been pressed twice. Note, however that we have REMed out line 50 so that you can break the program using the [ESC] key. (The alternative form of REM, an apostrophe, is used in line 50.). If line 50 was not disabled by REM, you could not then break from the program to check the listing or change it, unless BASIC tripped over an error -and there may not be one if you have been conscientious. Always remember to save yourself a breakable copy of programs where you use the ON BREAK command. Note that the same crosshatch subroutine at line 750 is used in Mode 0 for the crosshatch pattern, and in Mode 2 for the bandwidth/geometry pattern, demonstrating the compatibility of the graphics coordinates between different screen modes. Note also the SPEED INK statement in lines 60 and 700. This determines the speed at which alternate colours will flash. Finally when you have tested each routine for correct operation, you may unREM line 50 by deleting the apostrophe. Remember then to save the program onto cassette if you wish to keep, or further develop it, as once you RUN the program, the only way you will be able to break from it, will be by resetting the computer. Significant line numbers are as follows:
A point to note is the use of integer variables wherever possible to improve the speed of computation. 1) Draw a line along the centre of the input screen to mark the centre line for the cross section. 2) The ‘dot cursor' will erase any previously drawn lines whilst on its travels about the screen. See if you can write a routine to prevent this. Save the program on tape as we shall be using it again in later issues.
|