Personal Computer News
14th January 1984
Published in Personal Computer News #044
Colourful Adventure Writing On The Oric
Q. I plan to write a game on my 48K Oric but I don't know how to get different in different colours on the screen at the same time. I also want to get a program to RUN using a command in the program itself.
Ian Eden
Cannock, Staffs.
A. To get different colours on the screen in either HI- or LORES modes requires that you "send" an attribute to the screen. In LORES or TEXT, this is most easily done by PRINTing a CHR$ in the range 128 to 151 just before the item you want displayed. To have the string "PCN" in red ink on a black background, you would use PRINT CHR$(144);CHR$(129);"PCN". The first two CHR$() control the local INK and PAPER attributes for items to their right.
If you want to use this CHR$ method with PLOT, subtract 128 from the values given.
Another method is to send escape sequences before the displayed item, but this is not without its problems.
PRINT CHR$(N)
INK | COLOUR | PAPER |
128 | Black | 144 |
129 | Red | 145 |
130 | Green | 146 |
131 | Yellow | 147 |
132 | Blue | 148 |
133 | Magenta | 149 |
134 | Cyan | 150 |
135 | White | 151 |
136 | Single-height, standard characters | |
137 | Alternate character set | |
138 | Double-height characters | |
139 | Alternate character set | |
140 | Flashing characters | |
141 | Alternate character set, flashing | |
142 | Double-height, flashing characters | |
143 | Double-height, alternate, flashing |
To get a program to RUN itself, simply use the command in a program line (1020 in the example):
1000 PRINT "Do you want another go?"
1010 GET A$:IF A$<>"Y" AND A$<>"N" AND A$<>"n" THEN GOTO 1010
1020 IF A$="N" OR A$="n" THEN CLS:NEW ELSE RUN