home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug013.arc
/
COLOR3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
2KB
|
69 lines
program COLOR3;
{ Colour for MicroBee in Turbo Pascal
using a procedure which reads the
cursor position, and offsets it to
place the colour value in the
colour RAM
Program by Bob Burt }
procedure color(foreground, background, intensity : byte);
const
cursor = -8357; {address holding the low nybble of the cursor position}
colour_finish = -129; {end of colour RAM}
var
colour_start, colour_position : integer;
begin
port[8] := (intensity + 32)*2; {converts to correct value to set colour
RAM ON and RGB guns to ON or OFF }
colour_start := (mem[cursor + 1] - 240)*256 + mem[cursor] - 2048;
for colour_position := colour_start to colour_finish do
mem[colour_position] := background*32 + foreground
end; {procedure color}
begin {main}
clrscr;
gotoxy(1,4);
color(0,7,7);
writeln('This is Black on White');
delay(1000);
gotoxy(1,6);
color(4,3,7);
writeln('This is Red on Yellow');
delay(1000);
gotoxy(1,8);
color(21,6,7);
writeln('This is Magenta II on Cyan');
delay(1000);
gotoxy(1,10);
color(23,2,7);
writeln('This is White II on Green');
delay(1000);
gotoxy(1,12);
color(7,4,7);
writeln('This is White on Blue');
delay(1000);
gotoxy(1,14);
color(6,5,7);
writeln('This is Yellow on Magenta');
delay(1000);
gotoxy(1,16);
color(2,3,7);
writeln('This is Green on Yellow');
delay(1000);
gotoxy(1,18);
color(1,1,7);
writeln('This is Blue on Red');
delay(1000);
gotoxy(1,20);
color(5,2,7);
writeln('This is Magenta on Green');
delay(3000)
end. {main}