5.2.3 MODE 2
is the high resolution mode.
MODE 2
allows two colours to be used simlutaneously, and is used primarily for its ability to
produce 80 text characters per line - which makes a program much easier to write, since you can see
so much more of the program at a glance.
MODE 2
provides 640 pixels per horizontal row, again with 200 in each vertical column.
5.2.4 Try this....
With the CPC464 fully reset using
[CTRL][SHIFT][ESC],
type in this program:
5 R E M G R A P H I C S E X A M P L E D E M O N S T R A T I O N
10 MODE 1
15 INK 2,0
1 6 I N K 3 , 6 : R E M S E T S T H E C O L O U R U S E D I N LINE 90
17 BORDE R 1 : R E M D A R K B L U E
2 0 C L G : R E M C L E A N U P T H E D I S P L A Y
3 0 b % = R N D * 5 + 1 : R E M S E T U P P S E U D O
R A N D O M I N T E G E R V A R I A B L E S
40 c%=RND*5+1
5 0 O R I G I N 3 2 0 , 2 0 0 : R E M F I X T H E G R A P H I C S O R I G I N
60 FOR a = 0 TO 1000 STEP PI/30
7 0 x%=100*COS(a)
8 0 M O V E x % , x % : R E M M O V E T H E G R A P H I CS CURSOR
9 0 D R A W 2 0 0 * C O S ( a / b % ) , 2 0 0 * S I N (a/c%),3
: R E M D R A W T H E L I N E
9 1 I F I N K E Y S < > " " THEN 20
1 0 0 N E X T : R E M B A C K T O 6 0 U N L E S S I N T E R R U P T E D A T 9 1
110 GOTO 20
Now
RUN
the program. Hit ‘any key’ on the keyboard, to get another pattern. This demonstrates
several important features of the CPC464’s hardware and software: the CPC464 ‘writes the screen’
very smoothly without judder or ‘tearing’, and the software includes commands that permit very
sophisticated effects to be achieved with the minimum of effort. The
R EM
statements (
REM
arks) are
simply there for your convenience, you don’t need to include them for the program to work, it just
helps you (and particularly people who did not write the program in the first place) to understand
what’s going on.
Note that several of the line numbers indicate ‘afterthought’ entries - and whilst we could tidy the
listing by simply issuing a
RENUM
command, it will help you to follow the way in which programs
evolve and develop from their initial structures if we leave the original numbering.
SAVE this program on the cassette - eg:
S A V E " G R A P H I C S 5 . 5 . 8 4 "
Summary of Contents for CPC464
Page 1: ......
Page 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Page 118: ...TO DO DRAW THIS PAGE ...
Page 219: ...actual value may be made to vary during the execution of a program ...
Page 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Page 241: ......